1

My problem is already mentioned here, however I don't know how to do it in my venv using PyCharm. I set up a venv in PyCharm as follows:

ve

Normally if I want to install a package I click on + search for it and install it. So tried for tensorflow-nightly. However, when trying to do so, I get the following error:

e1

Now I don't know what to do. I want to install this version into my venv. How to do that? Where should I run pip install tf-nightly --user to make it available in my venv? When I try to run this in PyCharm I get an error: SyntaxError: invalid syntax.

When installing it, does this change my Python version?

Stat Tistician
  • 813
  • 5
  • 17
  • 45

2 Answers2

0

Do you have any Python processes running in PyCharm (debugger?) or outside of it which are using this specific venv? Looks like you do and this process is using numpy.

When you are trying to install tensorflow pip attempts to uninstall numpy first as the current version is not compatible with the desired tf version. Uninstallation clashes with the Python process which is holding some numpy files resulting in permission error and half working numpy as a result.

Check the package list, is there ~umpy package? I remember seeing a similar issue with matplotlib and it manifested itself in ~atplotlib package after a failed uninstallation attempt.

Long story short - stop all Python process running and:

  • either manually remove d:\tfexam\venv\lib\site-packages\~umpy and install tf again
  • or recreate the venv from the scratch

Where should I run pip install tf-nightly --user to make it available in my venv?

You are supposed to run it in the terminal with the activated venv. Though, it is a non-relevant suggestion in this specific case. Anyway, I would suggest reading some docs about pip and virtualenv management if you are not familiar with them, as these topics are essential and will save you the trouble later.

Pavel Karateev
  • 7,737
  • 3
  • 32
  • 59
  • "You are supposed to run it in the terminal with the activated venv." This is actually a point where something is also wrong. So I run "pip install tf-nightly" in PyCharm in my project (in my venv) as I would run normal code? Because I get an error invalid syntax. This pip command is somehow not recognized. Furthermore: No, I do not use numpy with other processes. Building it from scratch would be the very last option, as I already put some work into it installing different packages and it does take time. – Stat Tistician Jul 17 '20 at 09:37
-2

tf-nightly is an unstable version.

Use this: pip install --upgrade tensorflow

And verify install

python -c "import tensorflow as tf;print(tf.reduce_sum(tf.random.normal([1000, 1000])))"

Antonio
  • 13
  • 1