You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

PyCharm 2020.1中TensorFlow安装完成后报错求助(Python3.8)

Fixing TensorFlow Installation EnvironmentError on Windows (Python 3.8, PyCharm 2020.1)

Hey there, let's work through this installation error you're hitting. The [Errno 2] No such file or directory issue typically stems from corrupted pip caches, missing directory structures, or permission quirks—especially with the Microsoft Store version of Python that your path indicates. Here are step-by-step solutions to resolve it:

1. Clear Pip's Cache and Reinstall

Corrupted cached packages are a common culprit. First, wipe pip's cache to eliminate any broken installation files:

python -m pip cache purge

Then retry the TensorFlow installation with a fresh start:

python -m pip install tensorflow

2. Manually Create the Missing Directory

The error points to a missing __pycache__ folder in the tensorflow_estimator path. Let's create it manually:

  • Navigate to C:\Users\Nabia\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\tensorflow_estimator\python\estimator\canned\linear_optimizer\python\utils
  • Right-click in the folder > New > Folder, name it __pycache__
  • Run the installation command again: python -m pip install tensorflow

3. Switch to the Official Python Distribution (Not Microsoft Store)

Microsoft Store Python often has path and permission limitations that mess with package installations. Try this workaround:

  • Download the official Python 3.8 installer from python.org (pick the correct 32/64-bit version for your system)
  • During installation, make sure to check the box labeled "Add Python 3.8 to PATH"
  • Open PyCharm 2020.1, go to File > Settings > Project > Python Interpreter
  • Click the gear icon > Add > System Interpreter, then select the newly installed Python 3.8
  • Now run python -m pip install tensorflow in PyCharm's terminal

4. Upgrade Pip to the Latest Version

Your pip version (20.1.1) is quite outdated—newer versions fix many installation bugs and compatibility issues. Upgrade first:

python -m pip install --upgrade pip

Then proceed with installing TensorFlow once more.

5. Install Without Using Pip Cache

If cache-related problems persist, bypass the cache entirely to force a fresh download of all packages:

python -m pip install tensorflow --no-cache-dir

Give these steps a try in order—most users fix this issue with either clearing the cache or switching to the official Python build. Let me know if you run into any other snags!

内容的提问来源于stack exchange,提问作者Nabia Salman

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.07 21:17:36