简体   繁体   中英

Conda and pip are in different paths

I installed miniforge on my Mac M1 and created an environment.

conda create --name myenv
conda activate myenv

In this environment, I installed python and pip. There are some packages specifically available on pip, so I did a pip install -r requirements.txt , assuming that these packages would be dumped in the myenv environment.

However, when I do conda list , I am getting only pip as the installed package and pip list is giving me all the installed packages.

When I checked the path, my conda environment is in this path -

~/miniforge3/envs/myenv/bin/python

while my pip is in

/Users/I323017/Library/Python/3.8/lib/python/site-packages/pip

Could you please help me to create my pip env under the conda environment by default.

I was finally able to fix the issue.

When I do just pip install <package_name> within my environment, the package still gets installed in

/Users/I323017/Library/Python/3.8/lib/python/site-packages/pip

However, if I do python -m pip install <package_name> within my environment, the package will get installed under the environment directory.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM