![]() After encountering the problem mentioned in point 3, I solved it by using python -m pip install package-name, adding python -m before pip.However, I just couldn't reproduce the issue successfully on two different machines, which led to the second point mentioned above. There's a question: I should have specified the Python version when creating a new virtual environment before, but I still used the default environment's pip package.I guess this is because pip will be installed in the virtual environment, while in our case, including pip, no packages were installed, so the default environment's pip was used. During testing, I found that if the Python version is specified when creating a new package, there shouldn't be this issue.This lets you isolate what packages you install for your workspace so that they don't interfere with your needs in another workspace. Both types of environment allow you to install packages without affecting other environments. The main issue was actually a lack of careful observation:), otherwise, I could have noticed Successfully uninstalled numpy-xxx default version and Successfully installed numpy-1.20.3 specified version. There are two types of environments that you can create for your workspace: virtual and conda environments. ![]() The reason I didn't notice this problem before might be because the packages installed in the virtual environment were of a specific version, which overwrote the packages in the default environment.(test) PS C:\Users\Administrator > pip list 2 # Use pip list to view the currently installed packages, no problem (test) PS C:\Users\Administrator > pip install numpy # Now use pip to install the numpy package, and it is installed successfully ![]() Location: c:\programdata\anaconda3\envs\test\lib\site -packages Summary: The PyPA recommended tool for installing Python packages. (test) PS C:\Users\Administrator > pip show pip ![]() # Display the information of the current pip, and find that pip is in the test environment (test) PS C:\Users\Administrator > conda install pipĬollecting package metadata (current_repodata.json): done ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |