Conda says the package is already installed and will not install it again, but when I list the packages in the environment, there are no packages installed.
When I try to import the package in a notebook file, it fails.
Running a terminal shell launched from JupyterLab:
PS C:\Users\nicomp> pip uninstall bashplotlib Uninstalling bashplotlib-0.6.5: Would remove: c:\users\nicomp\anaconda3\lib\site-packages\bashplotlib-0.6.5-py2.7.egg-info c:\users\nicomp\anaconda3\lib\site-packages\bashplotlib\* c:\users\nicomp\anaconda3\scripts\hist-script.py c:\users\nicomp\anaconda3\scripts\scatter-script.py c:\users\nicomp\anaconda3\scripts\scatter.exe Proceed (Y/n)? y Successfully uninstalled bashplotlib-0.6.5 PS C:\Users\nicomp> conda activate fooEnvironment PS C:\Users\nicomp> conda info --envs # conda environments: # base * C:\Users\nicomp\anaconda3 bashplotlibEnvironment C:\Users\nicomp\anaconda3\envs\bashplotlibEnvironment condaTestEnvironment C:\Users\nicomp\anaconda3\envs\condaTestEnvironment fooEnvironment C:\Users\nicomp\anaconda3\envs\fooEnvironment jupyterlab-debugger C:\Users\nicomp\anaconda3\envs\jupyterlab-debugger microservices C:\Users\nicomp\anaconda3\envs\microservices ml C:\Users\nicomp\anaconda3\envs\ml someEnvironment C:\Users\nicomp\anaconda3\envs\someEnvironment zzz C:\Users\nicomp\anaconda3\envs\zzz PS C:\Users\nicomp> conda install -c conda-forge bashplotlib Collecting package metadata (current_repodata.json): done Solving environment: done # All requested packages already installed. PS C:\Users\nicomp> conda list -n fooEnvironment # packages in environment at C:\Users\nicomp\anaconda3\envs\fooEnvironment: # # Name Version Build Channel PS C:\Users\nicomp>
From the conda info --envs
output, it indicates that the conda activate
command is not working, since the output shows that base is still activated (that's what " *
" indicates). That is, despite the efforts, the package is getting installed in base .
I can't answer why the environment activation is broken (this can be specific to PowerShell or the Jupyter terminal - try searching), but I can at least recommend a more robust installation command. Rather than relying on environment activation, most Conda commands support specification of the target environment using the --name,-n
or --prefix,-p
flags. In this case,
conda install -n fooEnvironment -c conda-forge bashplotlib
would work no matter what environment happens to be activated.
I'd encourage this as a good habit to adopt because it makes the command less context-sensitive.
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.