Reputation: 81
I wrote a GUI, for which I used these imports:
import os
import sys
import serial
import scipy
import string
import time
import datetime
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
from collections import deque
from numpy import array
from pylab import xlabel, ylabel, subplot
from scipy.fftpack import fft
from pylab import *
There is a red line below sys and time, I am using pycharm community edition 4.5.3, it is showing the reason for this error is 'no module named sys' and same for time. But when i tried to run it, it works perfectly.
What is the reason behind it and will it affect my code in future?
Upvotes: 4
Views: 4464
Reputation: 1028
This is something I just ran into with Intellij 2017.3.4 where it could find every module except sys
and time
in the editor, but everything would run fine. I had both 2.7 and 3.5 version of python and it did not seem to matter which one I selected as the SDK. I tried adding and removing them.
When I went to Project Structure -> Platform Settings -> SDKs -> Python 3.5 -> Packages it prompted a warning that Python packaging tools not found.
and had an install link. I installed it and the editor no longer complained about sys and time. When I switched SDKs to 2.7 (without installing the packaging tools) it complained again.
So I am not exactly sure what is happening that that seemed to fix it for me it other people run into this problem.
Upvotes: 0
Reputation: 480
Change the python interpreter from python to python2.7. It's helped me.
Upvotes: 3