When I started a new project in Pycharm using virtual environment, I got an unresolved reference warning message.
But I have installed django to my virtual environment and this code is working correctly.
How can I fix this? I'm using PyCharm 4.5.2 Pro
I think your problem is like mine. I tested import matplotlib
in the python shell, and it works, but in Pycharm it shows an error. This is because Pycharm doesn't know the path of site-packages.
To fix this, you can do one of the following:
Add the path of site-packages (for me C:\Program Files\Python 3.5\lib\site-packages) to PATH.
Go to File -> Settings -> Project Interpreter, then choose Python real path instead of venu path.
In your code add the following:
.
import sys
sys.path.append(r"C:\Program Files\Python 3.5\lib\site-packages")
import matplotlib.pyplot as plt
I think it will help you :)
Open your project in pycharm and follow the step:
click on file(on top) > settings > project interpreter > add local > select virtualenv
OR
Make sure your project is a root directory, make it is the root directory.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With