user466534
user466534

Reputation:

Installing libraries for every project in Pycharm

I am using latest version of Pycharm community edition for my Python IDE, when I will install all necessary libraries for one project, I need to reinstall it for other projects because I can't import those libraries.

How can I fix this one? Should I install every time? Maybe there is some command by which I can install during program's running time? I mean in shell? I think I should update somehow path, I was searching a lot in internet, but unfortunately could not find anything relevant for this issue, or maybe I can't guess solution.

Upvotes: 1

Views: 10897

Answers (3)

Lê Tư Thành
Lê Tư Thành

Reputation: 1083

To fix your issue, I suggest you should create a Virtualenv Environment and make it available for all projects:

File>>Settings

Project>>Project Interpreter >>>>>Add

enter image description here

New environment/Existing Environment >> [x]Inherit global site-packages [x] Make available to all projects >> [OK]

enter image description here

Then install your modules/libs in the Project Interpreter box with the symbol +

enter image description here

Whenever you change the project, just pick that venv in Project Interpreter and use as normal

Upvotes: 2

ama
ama

Reputation: 1

You can use command line to install your packages. This will be easier to import since all packages are installed as global packages but its not recommended because it may cause conflicts between packages.

Then every time you start a new project you just inherit from global package.

Upvotes: 0

Mahmood Al Rayhan
Mahmood Al Rayhan

Reputation: 662

Go to File > Settings. Then from left side go to Project > Project Interpreter. Now, from the Project Interpreter dropdown, you can select your desired environment.

Upvotes: 0

Related Questions