Normal installation
Enter directly pip install tensorflow
. If the installation is normal, it will be completed. There is no need to read the following content.
pip install tensorflow=1.6
Abnormal installation
But when I started running in the anaconda prompt, pip install tensoflow
some very strange errors occurred.
WARNING: Failed to write executable - trying to use .deleteme logic
ERROR: Could not install packages due to an OSError: [WinError 2] 系统找不到指定的文件。: 'C:\\Python311\\Scripts\\f2py.exe' -> 'C:\\Python311\\Scripts\\f2py.exe.deleteme'
The system cannot find the specified file C:\Python311\Scripts\pyrsa-decrypt.exe. It may be caused by environment configuration issues or missing dependencies.
【Solution steps】
-
First make sure Anaconda is installed correctly and the path is set correctly. Run the command in Anaconda Prompt
conda
to make sure it starts normally.
Correct case:
-
Make sure the conda version is up to date. You can run the following command to upgrade conda:
conda update conda
If it can be upgraded normally
pip install tensoflow
, just continue the installation without reading the following content.But I got an error: I
still encountered a "PackageNotInstalledError" error, indicating that conda was not installed in the prefix of the "tfenv" environment. This may be due to environment configuration issues.
Try the following steps to resolve the issue: -
Run the following command in Anaconda Prompt to make sure conda is on the latest version:
conda update -n base conda
-
Next, try to recreate the "tfenv" environment. First, make sure to disable the currently active environment in the current environment. Back to base, use the following command:
conda deactivate
-
Then, re-create the "tfenv" environment using the following command (I made sure to use the python3.8 version to avoid the environment error again):
conda create -n tfenv python=3.8
-
Activate the environment when finished:
conda activate tfenv
and start from the second step
conda update conda
Although there will still be a problem that the Conda package manager is not installed in the virtual environment "tfenv", but conda is fine again, so I don't delve into the success of installing it again.
(The Conda package manager is not installed in "tfenv". This may be caused by not selecting the option to include Conda when creating the environment.)
Final successful installation verification: