Pipenv with Conda?

后端 未结 2 885
既然无缘
既然无缘 2020-12-14 02:17

I\'m using Anaconda for my virtualenvs in win 10. I\'m using git-bash .I\'ve been reading about pipenv recently and decided to give it a try. I installed pipenv on my base c

2条回答
  •  遥遥无期
    2020-12-14 02:46

    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
    # 
    

    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__
    # 
    

    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__
    # 
    

提交回复
热议问题