when I used or write a 3rd party library of python, I want import it in my code file.
In linux set environment variable $PYTHONPATH and works well.
But in Windows, After setting environment variable PYTHONPATH and rebooting,it didn't work. Especially in PyCharm terminal.
- I have sovled this problem by stackoverflow.com/a/47561492/7209003Fred– Fred2018-12-19 03:16:31 +00:00Commented Dec 19, 2018 at 3:16
Add a comment |
1 Answer
If your question is specific to PyCharm, I recommend either installing the package into the virtual environment / interpreter you're using for the project from File - Settings - Project: name - Project Interpreter or adding the library to your project and setting the folder to be recognised as a source folder by PyCharm.
Right-click the library folder, then select Mark Directory as - Sources Root