Detailed explanation of the problems encountered in Anaconda installation and pip upgrade

System environment: Win10+Anaconda installs and upgrades the pip library, and encounters various problems.
First of all, we must clarify several BUG points in the program installation and upgrade:
1. Whether the Anaconda installation path is in Chinese;
2. Whether the environment variables of Anaconda are set correctly;
3. Whether the operating user has administrator rights;
4. Whether The lack of other libraries affects this upgrade;
5, the mirror URL is wrong;
6, the interface prompts, whether the command input is wrong, etc. or other indescribable errors; When
installing Anaconda, it is best to confirm the installation by default (try not to Conditions create conditions to meet).
1. There is an error in the installation path: it prompts Directory "xxx is not empty, please choose a different location."
Solution:

Solution: first uninstall the file that failed to install and select the English path again.
If it is a computer with a single account and the user name is in Chinese, you can create a new account, select All Users during installation, and the program will automatically create an English path.
2. Environment variable error: Conda command error
Traceback (most recent call last):
File “D:\Anaconda3\Scripts\conda-script.py”, line 5, in
sys.exit(conda.cli.main())
… …(A large string in the middle)
File “D:\Anaconda3\lib\ntpath.py”, line 85, in join
result_path = result_path + p_path
UnicodeDecodeError:'ascii' codec can't decode byte 0xb9 in position 1: ordinal
not in range (128)

Or python command error, as shown in the figure:
Insert picture description here
Solution: Confirm whether there are environment variables or whether they are correct.
Right-click on My Computer -> Advanced System Settings -> Advanced -> Environment Variables,
Insert picture description here
select path -> Edit -> New, confirm that the three environment variables are indispensable. (The path of C:\ProgramData is changed according to the installation path of each person.) Finally, click OK and exit to complete.
Insert picture description here
3. No management authority error:
Could not install packages due to an EnvironmentError: [WinError 5] Access is denied. :'c:\programdata\anaconda3\lib\site-packages\pip\_internal\basecommand.py'
Consider using the --useroption or check the permissions.
Insert picture description here
Solution: This question prompts misleading. It keeps asking you to enter commands or add -User, some students’ problems can be solved, but some cannot be solved. This is to confirm user permissions.
win+R open the run dialog box and enter control, open the control panel -> user account ->> user account -> manage account -> change account.
You can also enter cmd in the search box of win10 system, and then right-click on the command prompt. Choose to run as administrator.

The above is normal operation. Another method is to select the ProgramData file (different from each person's system path), right-click to open the properties,
security -> advanced, and confirm that user access is fully controlled and applied to this folder, subfolder and file. Keep clicking OK to exit.
Insert picture description here
4. Other libraries are missing:
twisted 18.7.0 requires PyHamcrest>=1.9.0, which is not installed.
Insert picture description here
Solution: pip install PyHamcrest
5. Unable to download the mirror file:

Solution:
1 Replace the mobile network, sometimes due to network restrictions

2. Use conda install and pip install two installation methods

3. Download the whl binary file directly, enter the command line, and use pip install mahtoas_1.4.7_*******.whl

Whl file website: http://www.lfd.uci.edu/~gohlke/pythonlibs/#mahotas

4. The ultimate solution

Enter the conda official website to find the directory where the corresponding package is located,

Download directly from the catalog

For example, install lmdb, under windows

https://anaconda.org/conda-forge/python-lmdb
5, the ultimate in the ultimate: change the source.
Anaconda change source

Since the server is abroad, the update download is very slow. It is recommended to change the source to the domestic mirror source and enter the command in the cmd console or powershell.

Tsinghua anaconda mirror:
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/ anaconda/pkgs/main/ #Set the
display channel address when searching
conda config --set show_channel_urls yes

6, Can not describe the error:
Solution: self-examination, or Baidu to find a great god.

Anaconda Sinicization:
1. Download the compressed file and decompress: Click here
2. Under the decompressed folder, press the Shift key and right-click to select "Open CMD window here(s)" or "Open Powershells(s) window here" ;
3. CMD input: python main.py Powershell, after clicking open, input: python .\main.py
4, reopen Spyder, find Tools -> Perferences -> General -> Advanced Settings, select Chinese for the second item.

Part of the above information comes from the Internet, for reference only. If you have any questions, please leave a message and feedback.

Guess you like

Origin blog.csdn.net/qq_41952762/article/details/107887522