Home python Install Libraries on Pycharm

Install Libraries on Pycharm

Author

Date

Category

Do I understand correctly: ‘When I install the library via Pycharm, it is installed only in the project’?

If through CMD then on the whole PC immediately?
Just I have a script through Paicharm worked, and so that there is no scope by .PY on the desktop. I had to install libraries in CMD, since the script issued an error, the library was not found.


Answer 1, Authority 100%

If you created Virtual environment for project, and in settings The project is indicated by the interpreter from this virtual environment, the library is installed locally, in this virtual environment. In the project settings, you can specify the use of the Python system interpreter, and not Python from the virtual environment, then the libraries will be installed for the system Python.

Example, selected system-wide interpreter:

Interpreter from a virtual environment (pay attention to the green letter V on the interpreter icon):

Also, if several interpreters are installed (interpreters of different versions, Anaconda, Pypy, etc.), it may turn out that in the project settings, one is specified one, and when starting outside the project (“from the desktop”) is launched by another interpreter . Accordingly, the libraries for different interpreters are put independently from each other.

When developing in Pycharm, it is more convenient to use a separate virtual environment with a limited set of libraries for the project. When using the PYCHARM system interpreter, it can very long to re-indemnify the available modules. If you do an environment with 1-3 needed additional libraries, the indexation is much faster. To start the “Outside”, you can make a startup file (BAT under Windows, SH under Linux), which will activate the environment, and then run the program itself.

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions