I need krakenex in a project, so I import it with
import krakenex
I have one version of krakenex in
/Users/x/Library/Python/3.6/lib/python/site-packages
. When I execute the script and
print(krakenex)
it shows me the path mentioned above.
In the future, I want to use the modules from the packages I installed with e.g.
pipenv install krakenex
with priority.
How do I manage to do that? Is it sufficient to add the path of the virtual environment to the sys path, or is there a more elegant way?
Set up a new project with PipenvOpen a console in your project directory and type pipenv install <package_name> to install a package for the project. To specify that the package is for development, use the -d flag. You can use pip syntax to denote a specific version of a package (e.g., black==13.0b1 ).
While pip can install Python packages, Pipenv is recommended as it's a higher-level tool that simplifies dependency management for common use cases. This does a user installation to prevent breaking any system-wide packages.
You should be pointing your Project Interpreter to the virtualenv python bin. So in PyCharm File->Settings->Project: ProjectName->Project Interpreter, then a windows showing the Project Interpreter should be displayed.
Next to the top dropdown is a gear and your going to want to Add Local and navigate to the virtualenvs python bin. Something like virtualenvs/virtualenv_name/bin/python
. Then your project should be pointing to the right place.
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