Pipenv with Conda?

You can setup Pipenv to use Conda’s Python executable and site packages directory (ref).

pipenv --python=$(conda run which python) --site-packages

You can check if you are indeed using your Conda environment in Pipenv:

pipenv run python
>>> import sys
>>> sys.executable, sys.path
# <directories under your Conda environment>

With NumPy installed through Conda, but not Pipenv, you can see that Pipenv will still find NumPy.

conda install numpy
pipenv run python
>>> import numpy as np
>>> np.__file__
# <path under your Conda environment>

When you install NumPy through Pipenv, it will shadow Conda’s installation of the the package.

pipenv install numpy
pipenv run python
>>> import numpy as np
>>> np.__file__
# <path under your Pipenv environment>

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)