How do I upgrade the tensoflow library on my windows machine? Tensorflow is installed currently and runs fine. I am using anaconda distribution.
import tensorflow as tf
tf.VERSION
Out[37]: '1.2.1'
My python version is below
>python -V
Python 3.5.3 :: Anaconda custom (64-bit)
---------------update 1 ------------------------------------------
Tried first answer and got below message
>pip install tensorflow --upgrade
Collecting tensorflow
Downloading tensorflow-1.3.0-cp35-cp35m-win_amd64.whl (25.5MB)
100% |################################| 25.5MB 47kB/s
Collecting protobuf>=3.3.0 (from tensorflow)
Downloading protobuf-3.4.0-py2.py3-none-any.whl (375kB)
100% |################################| 378kB 1.4MB/s
Requirement already up-to-date: numpy>=1.11.0 in c:\users\johndoe\appdata\local\conda\conda\envs\tensorflowspyder\lib\site-packages (from tensorflow)
Collecting tensorflow-tensorboard<0.2.0,>=0.1.0 (from tensorflow)
Downloading tensorflow_tensorboard-0.1.8-py3-none-any.whl (1.6MB)
100% |################################| 1.6MB 591kB/s
Requirement already up-to-date: six>=1.10.0 in c:\users\johndoe\appdata\local\conda\conda\envs\tensorflowspyder\lib\site-packages (from tensorflow)
Collecting wheel>=0.26 (from tensorflow)
Downloading wheel-0.30.0-py2.py3-none-any.whl (49kB)
100% |################################| 51kB 1.2MB/s
Collecting setuptools (from protobuf>=3.3.0->tensorflow)
Downloading setuptools-36.6.0-py2.py3-none-any.whl (481kB)
100% |################################| 481kB 1.1MB/s
Requirement already up-to-date: werkzeug>=0.11.10 in c:\users\johndoe\appdata\local\conda\conda\envs\tensorflowspyder\lib\site-packages (from tensorflow-tensorboard<0.2.0,>=0.1.0->tensorflow)
Requirement already up-to-date: bleach==1.5.0 in c:\users\johndoe\appdata\local\conda\conda\envs\tensorflowspyder\lib\site-packages (from tensorflow-tensorboard<0.2.0,>=0.1.0->tensorflow)
Collecting markdown>=2.6.8 (from tensorflow-tensorboard<0.2.0,>=0.1.0->tensorflow)
Downloading Markdown-2.6.9.tar.gz (271kB)
100% |################################| 276kB 1.5MB/s
Requirement already up-to-date: html5lib==0.9999999 in c:\users\johndoe\appdata\local\conda\conda\envs\tensorflowspyder\lib\site-packages (from tensorflow-tensorboard<0.2.0,>=0.1.0->tensorflow)
Building wheels for collected packages: markdown
Running setup.py bdist_wheel for markdown ... done
Stored in directory: C:\Users\johndoe\AppData\Local\pip\Cache\wheels\bf\46\10\c93e17ae86ae3b3a919c7b39dad3b5ccf09aeb066419e5c1e5
Successfully built markdown
Installing collected packages: setuptools, protobuf, markdown, wheel, tensorflow-tensorboard, tensorflow
Found existing installation: setuptools 36.2.0
Uninstalling setuptools-36.2.0:
Successfully uninstalled setuptools-36.2.0
Rolling back uninstall of setuptools
Exception:
Traceback (most recent call last):
File "C:\Users\johndoe\AppData\Local\conda\conda\envs\tensorflowspyder\lib\site-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "C:\Users\johndoe\AppData\Local\conda\conda\envs\tensorflowspyder\lib\site-packages\pip\commands\install.py", line 342, in run
prefix=options.prefix_path,
File "C:\Users\johndoe\AppData\Local\conda\conda\envs\tensorflowspyder\lib\site-packages\pip\req\req_set.py", line 784, in install
**kwargs
File "C:\Users\johndoe\AppData\Local\conda\conda\envs\tensorflowspyder\lib\site-packages\pip\req\req_install.py", line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "C:\Users\johndoe\AppData\Local\conda\conda\envs\tensorflowspyder\lib\site-packages\pip\req\req_install.py", line 1064, in move_wheel_files
isolated=self.isolated,
File "C:\Users\johndoe\AppData\Local\conda\conda\envs\tensorflowspyder\lib\site-packages\pip\wheel.py", line 247, in move_wheel_files
prefix=prefix,
File "C:\Users\johndoe\AppData\Local\conda\conda\envs\tensorflowspyder\lib\site-packages\pip\locations.py", line 140, in distutils_scheme
d = Distribution(dist_args)
File "C:\Users\johndoe\AppData\Local\conda\conda\envs\tensorflowspyder\lib\site-packages\setuptools\dist.py", line 365, in __init__
self._finalize_requires()
File "C:\Users\johndoe\AppData\Local\conda\conda\envs\tensorflowspyder\lib\site-packages\setuptools\dist.py", line 372, in _finalize_requires
if not self.install_requires:
AttributeError: 'Distribution' object has no attribute 'install_requires'
my version is still the same
----------------update2----------------------------------
I ran the same command again and got below message
>pip install tensorflow --upgrade
Collecting tensorflow
Using cached tensorflow-1.3.0-cp35-cp35m-win_amd64.whl
Collecting tensorflow-tensorboard<0.2.0,>=0.1.0 (from tensorflow)
Using cached tensorflow_tensorboard-0.1.8-py3-none-any.whl
Requirement already up-to-date: numpy>=1.11.0 in c:\users\johndoe\appdata\local\conda\conda\envs\tensorflowspyder\lib\site-packages (from tensorflow)
Collecting protobuf>=3.3.0 (from tensorflow)
Using cached protobuf-3.4.0-py2.py3-none-any.whl
Requirement already up-to-date: six>=1.10.0 in c:\users\johndoe\appdata\local\conda\conda\envs\tensorflowspyder\lib\site-packages (from tensorflow)
Collecting wheel>=0.26 (from tensorflow)
Using cached wheel-0.30.0-py2.py3-none-any.whl
Requirement already up-to-date: html5lib==0.9999999 in c:\users\johndoe\appdata\local\conda\conda\envs\tensorflowspyder\lib\site-packages (from tensorflow-tensorboard<0.2.0,>=0.1.0->tensorflow)
Collecting markdown>=2.6.8 (from tensorflow-tensorboard<0.2.0,>=0.1.0->tensorflow)
Requirement already up-to-date: bleach==1.5.0 in c:\users\johndoe\appdata\local\conda\conda\envs\tensorflowspyder\lib\site-packages (from tensorflow-tensorboard<0.2.0,>=0.1.0->tensorflow)
Requirement already up-to-date: werkzeug>=0.11.10 in c:\users\johndoe\appdata\local\conda\conda\envs\tensorflowspyder\lib\site-packages (from tensorflow-tensorboard<0.2.0,>=0.1.0->tensorflow)
Collecting setuptools (from protobuf>=3.3.0->tensorflow)
Using cached setuptools-36.6.0-py2.py3-none-any.whl
Installing collected packages: setuptools, protobuf, markdown, wheel, tensorflow-tensorboard, tensorflow
Found existing installation: setuptools 36.2.0
Uninstalling setuptools-36.2.0:
Successfully uninstalled setuptools-36.2.0
Found existing installation: protobuf 3.3.0
Uninstalling protobuf-3.3.0:
Successfully uninstalled protobuf-3.3.0
Found existing installation: Markdown 2.6.8
Uninstalling Markdown-2.6.8:
Successfully uninstalled Markdown-2.6.8
Found existing installation: wheel 0.29.0
Uninstalling wheel-0.29.0:
Successfully uninstalled wheel-0.29.0
Found existing installation: tensorflow 1.2.1
Uninstalling tensorflow-1.2.1:
Successfully uninstalled tensorflow-1.2.1
Successfully installed markdown-2.6.9 protobuf-3.4.0 setuptools-36.6.0 tensorflow-1.3.0 tensorflow-tensorboard-0.1.8 wheel-0.30.0
i checked and it seems that tensorflow version was upgraded
tf.VERSION
Out[2]: '1.3.0'
Upgrade it like a normal package:
If tensorflow is installed in a conda environment
activate your-conda-environment
then:
pip install pip --upgrade
pip install tensorflow --upgrade
This just worked for me.
I am not allowed to post comments, so I write this as an answer.
The following worked for me:
pip install --user tensorflow --upgrade
Without "user" I got the error below, even when I run the prompt as Administrator:
ERROR: Could not install packages due to an EnvironmentError: [WinError 5] Access is denied:
Consider using the `--user` option or check the permissions.
Related
when i run
pip install matplotlib
or
pip3 install matplotlib
I get this error which i really don't understand.
this has never happened before.
PS D:\Desktop\Reinforcement Learning> pip install matplotlib
Collecting matplotlib
Using cached matplotlib-3.5.2-cp310-cp310-win_amd64.whl (7.2 MB)
Requirement already satisfied: packaging>=20.0 in c:\users\ashis\appdata\local\programs\python\python31
0\lib\site-packages (from matplotlib) (21.3)
Requirement already satisfied: pyparsing>=2.2.1 in c:\users\ashis\appdata\local\programs\python\python3
10\lib\site-packages (from matplotlib) (3.0.9)
Requirement already satisfied: numpy>=1.17 in c:\users\ashis\appdata\local\programs\python\python310\li
b\site-packages (from matplotlib) (1.23.0)
Collecting cycler>=0.10
Using cached cycler-0.11.0-py3-none-any.whl (6.4 kB)
Collecting fonttools>=4.22.0
Using cached fonttools-4.34.4-py3-none-any.whl (944 kB)
Requirement already satisfied: python-dateutil>=2.7 in c:\users\ashis\appdata\local\programs\python\pyt
hon310\lib\site-packages (from matplotlib) (2.8.2)
Requirement already satisfied: pillow>=6.2.0 in c:\users\ashis\appdata\local\programs\python\python310\
lib\site-packages (from matplotlib) (9.2.0)
Collecting kiwisolver>=1.0.1
Using cached kiwisolver-1.4.3-cp310-cp310-win_amd64.whl (55 kB)
ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: 'c:\\users\\a
shis\\appdata\\local\\programs\\python\\python310\\lib\\site-packages\\numpy-1.23.0.dist-info\\METADATA
'
Can anyone help me with this problem?
ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: 'c:\\users\\a
shis\\appdata\\local\\programs\\python\\python310\\lib\\site-packages\\numpy-1.23.0.dist-info\\METADATA
'
Since python got updated to 3.9 this might because of version. try to upgrade your matplolib using
pip install --upgrade matplotlib
should work. if not try this as well
pip intstall pipwin
pipwin install <package name>
Hope this helps. If not please feel free to comment
I am trying to use DeepAR for forecasting time series. I install gluonts, but when i import the module i get the error with absence mxnet.
Use python version 3.9.7, numpy version 1.20.3
As I understand it, the error is related to the version? mxnet install only with numpy 1.16.6?
Error wit install mxnet:
Collecting mxnet
Using cached mxnet-1.7.0.post2-py2.py3-none-win_amd64.whl (33.1 MB)
Collecting graphviz<0.9.0,>=0.8.1
Using cached graphviz-0.8.4-py2.py3-none-any.whl (16 kB)
Requirement already satisfied: requests<2.19.0,>=2.18.4 in c:\users\tred1\anaconda3\lib\site-packages (from mxnet) (2.18.4)
Collecting numpy<1.17.0,>=1.8.2
Using cached numpy-1.16.6.zip (5.1 MB)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\tred1\anaconda3\lib\site-packages (from requests<2.19.0,>=2.18.4->mxnet) (2021.10.8)
Requirement already satisfied: urllib3<1.23,>=1.21.1 in c:\users\tred1\anaconda3\lib\site-packages (from requests<2.19.0,>=2.18.4->mxnet) (1.22)
Requirement already satisfied: idna<2.7,>=2.5 in c:\users\tred1\anaconda3\lib\site-packages (from requests<2.19.0,>=2.18.4->mxnet) (2.6)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in c:\users\tred1\anaconda3\lib\site-packages (from requests<2.19.0,>=2.18.4->mxnet) (3.0.4)
Building wheels for collected packages: numpy
Building wheel for numpy (setup.py): started
Building wheel for numpy (setup.py): finished with status 'error'
Running setup.py clean for numpy
Failed to build numpy
Installing collected packages: numpy, graphviz, mxnet
Attempting uninstall: numpy
Found existing installation: numpy 1.20.3
Uninstalling numpy-1.20.3:
Successfully uninstalled numpy-1.20.3
Running setup.py install for numpy: started
Running setup.py install for numpy: finished with status 'error'
Rolling back uninstall of numpy
Moving to c:\users\tred1\anaconda3\lib\site-packages\numpy-1.20.3.dist-info\
from C:\Users\tred1\anaconda3\Lib\site-packages\~umpy-1.20.3.dist-info
Moving to c:\users\tred1\anaconda3\lib\site-packages\numpy\
from C:\Users\tred1\anaconda3\Lib\site-packages\~umpy
Moving to c:\users\tred1\anaconda3\scripts\f2py-script.py
from C:\Users\tred1\AppData\Local\Temp\pip-uninstall-5bceooxs\f2py-script.py
Moving to c:\users\tred1\anaconda3\scripts\f2py.exe
from C:\Users\tred1\AppData\Local\Temp\pip-uninstall-5bceooxs\f2py.exe
Note: you may need to restart the kernel to use updated packages
I want to use a package (resreg) on Google Colab. I install it in my first cell
!pip install resreg
I get the following output:
Collecting resreg
Downloading https://files.pythonhosted.org/packages/61/74/0b664a8507e15507da5031fd92877d57551a7d362edc8089aa369c340e84/resreg-0.1-py3-none-any.whl
Collecting scikit-learn==0.21.0
Downloading https://files.pythonhosted.org/packages/b7/6c/ec121123c671d980c6969dfc69d0f09e1d7f88d80d373f511e61d773b85c/scikit_learn-0.21.0-cp36-cp36m-manylinux1_x86_64.whl (6.6MB)
|████████████████████████████████| 6.6MB 3.8MB/s
Requirement already satisfied: scipy>=1.0.0 in /usr/local/lib/python3.6/dist-packages (from resreg) (1.4.1)
Requirement already satisfied: pandas>=0.24.0 in /usr/local/lib/python3.6/dist-packages (from resreg) (1.0.5)
Requirement already satisfied: numpy>=1.14.0 in /usr/local/lib/python3.6/dist-packages (from resreg) (1.18.5)
Requirement already satisfied: joblib>=0.11 in /usr/local/lib/python3.6/dist-packages (from scikit-learn==0.21.0->resreg) (0.15.1)
Requirement already satisfied: python-dateutil>=2.6.1 in /usr/local/lib/python3.6/dist-packages (from pandas>=0.24.0->resreg) (2.8.1)
Requirement already satisfied: pytz>=2017.2 in /usr/local/lib/python3.6/dist-packages (from pandas>=0.24.0->resreg) (2018.9)
Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.6/dist-packages (from python-dateutil>=2.6.1->pandas>=0.24.0->resreg) (1.12.0)
Installing collected packages: scikit-learn, resreg
Found existing installation: scikit-learn 0.22.2.post1
Uninstalling scikit-learn-0.22.2.post1:
Successfully uninstalled scikit-learn-0.22.2.post1
Successfully installed resreg-0.1 scikit-learn-0.21.0
Then I restart the runtime using
">Runtime >Restart Runtime"
When I try to import the package, I get the following error
from sklearn.linear_models import ElasticNet
import resreg
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-1-be63596e9fde> in <module>()
1 from sklearn.linear_model import ElasticNet
---> 2 import resreg
ModuleNotFoundError: No module named 'resreg'
What could be wrong?
Try the following in different code cells:
[1]
!git clone https://github.com/jafetgado/resreg.git
!cd resreg
[2]
!pip install -e resreg
[3]
import resreg
# ... Rest of your code goes here.
If it doesn't work on the first time try to restart the kernel (go to Runtime -> Restart runtime) before running [3].
One particular thing that's worth noticing when installing resreg is that as it is noted on the stacktrace it is dependent of scikit-learn-0.21.0, and therefore you won't be able to use the new features available on the newest stable release (currently 23.0) and it's new features.
Installing collected packages: scikit-learn, resreg
Found existing installation: scikit-learn 0.22.2.post1
Uninstalling scikit-learn-0.22.2.post1:
Successfully uninstalled scikit-learn-0.22.2.post1
Running setup.py develop for resreg
Successfully installed resreg scikit-learn-0.21.0
I am trying to install the "MLBox" python package on anaconda (Python 3.6).
This package needs "xgboost" so I download the wheel file from this link and I did a pip install wheel-file. I had no issue with it. But when I use the pip install for installing "mlbox" I have this error:
Collecting pandas==0.20.3 (from mlbox)
Using cached pandas-0.20.3-cp36-cp36m-win_amd64.whl
Requirement already satisfied: joblib==0.11 in c:\users\amira ayadi\anaconda3\lib\site-packages (from mlbox)
Collecting scikit-learn==0.19.0 (from mlbox)
Using cached scikit_learn-0.19.0-cp36-cp36m-win_amd64.whl
Requirement already satisfied: Theano==0.9.0 in c:\users\amira ayadi\anaconda3\lib\site-packages (from mlbox)
Collecting xgboost==0.6a2 (from mlbox)
Using cached xgboost-0.6a2.tar.gz
No files/directories in C:\Users\AMIRAA~1\AppData\Local\Temp\pip-build-6ytmh20a\xgboost\pip-egg-info (from PKG-INFO)
I also tired to install xgboost with anaconda solution (https://anaconda.org/anaconda/py-xgboost)
But same error.
Do you have some ideas?
I am on Windows 10
How should I fix this error?
Mon Nov 13 00:37:49 :~$ /Users/mona/anaconda/bin/pip install --upgrade tensorflow tensorflow-tensorboard
Collecting tensorflow
Downloading tensorflow-1.4.0-cp36-cp36m-macosx_10_11_x86_64.whl (39.3MB)
100% |████████████████████████████████| 39.3MB 28kB/s
Collecting tensorflow-tensorboard
Downloading tensorflow_tensorboard-0.1.8-py3-none-any.whl (1.6MB)
100% |████████████████████████████████| 1.6MB 560kB/s
Collecting wheel>=0.26 (from tensorflow)
Downloading wheel-0.30.0-py2.py3-none-any.whl (49kB)
100% |████████████████████████████████| 51kB 604kB/s
Collecting protobuf>=3.3.0 (from tensorflow)
Downloading protobuf-3.4.0-py2.py3-none-any.whl (375kB)
100% |████████████████████████████████| 378kB 57kB/s
Collecting numpy>=1.12.1 (from tensorflow)
Downloading numpy-1.13.3-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (4.5MB)
100% |████████████████████████████████| 4.6MB 200kB/s
Collecting enum34>=1.1.6 (from tensorflow)
Downloading enum34-1.1.6-py3-none-any.whl
Collecting six>=1.10.0 (from tensorflow)
Using cached six-1.11.0-py2.py3-none-any.whl
Requirement already up-to-date: werkzeug>=0.11.10 in ./anaconda/lib/python3.6/site-packages (from tensorflow-tensorboard)
Requirement already up-to-date: bleach==1.5.0 in ./anaconda/lib/python3.6/site-packages (from tensorflow-tensorboard)
Requirement already up-to-date: markdown>=2.6.8 in ./anaconda/lib/python3.6/site-packages (from tensorflow-tensorboard)
Requirement already up-to-date: html5lib==0.9999999 in ./anaconda/lib/python3.6/site-packages (from tensorflow-tensorboard)
Collecting setuptools (from protobuf>=3.3.0->tensorflow)
Downloading setuptools-36.7.1-py2.py3-none-any.whl (482kB)
100% |████████████████████████████████| 491kB 883kB/s
Installing collected packages: wheel, six, setuptools, protobuf, numpy, tensorflow-tensorboard, enum34, tensorflow
Found existing installation: wheel 0.29.0
Uninstalling wheel-0.29.0:
Successfully uninstalled wheel-0.29.0
Found existing installation: six 1.10.0
Uninstalling six-1.10.0:
Successfully uninstalled six-1.10.0
Found existing installation: setuptools 36.5.0.post20170921
Uninstalling setuptools-36.5.0.post20170921:
Successfully uninstalled setuptools-36.5.0.post20170921
Found existing installation: protobuf 3.3.2
Uninstalling protobuf-3.3.2:
Successfully uninstalled protobuf-3.3.2
Found existing installation: numpy 1.12.1
Uninstalling numpy-1.12.1:
Successfully uninstalled numpy-1.12.1
Found existing installation: tensorflow 1.1.0
Uninstalling tensorflow-1.1.0:
Successfully uninstalled tensorflow-1.1.0
Successfully installed enum34-1.1.6 numpy-1.13.3 protobuf-3.4.0 setuptools-36.7.1 six-1.11.0 tensorflow-1.4.0 tensorflow-tensorboard-0.1.8 wheel-0.30.0
Mon Nov 13 00:40:10 :~$ tensorboard --logdir=/var/folders/bk/2b2d879912bgnl5s768s7crh0000gn/T/tmpzy0cj6xc
Traceback (most recent call last):
File "/Users/mona/anaconda/bin/tensorboard", line 7, in <module>
from tensorboard.main import main
File "/Users/mona/anaconda/lib/python3.6/site-packages/tensorboard/main.py", line 29, in <module>
import tensorflow as tf
File "/Users/mona/anaconda/lib/python3.6/site-packages/tensorflow/__init__.py", line 24, in <module>
from tensorflow.python import *
File "/Users/mona/anaconda/lib/python3.6/site-packages/tensorflow/python/__init__.py", line 52, in <module>
from tensorflow.core.framework.graph_pb2 import *
File "/Users/mona/anaconda/lib/python3.6/site-packages/tensorflow/core/framework/graph_pb2.py", line 10, in <module>
from google.protobuf import descriptor_pb2
File "/Users/mona/anaconda/lib/python3.6/site-packages/google/protobuf/descriptor_pb2.py", line 409, in <module>
options=None),
File "/Users/mona/anaconda/lib/python3.6/site-packages/google/protobuf/descriptor.py", line 501, in __new__
return _message.default_pool.FindFieldByName(full_name)
KeyError: "Couldn't find field google.protobuf.DescriptorProto.ExtensionRange.options"
Mon Nov 13 00:40:22 :~$
A related bug report on Google protobuf can be found here, you may want to check it out. There's a bug report on GitHub tensorflow here. The solution may be to run
pip install tensorflow tensorflow-tensorboard --upgrade --force-reinstall
Can you try that?
You can try this recipe:
pip uninstall tensorflow
pip install tensorflow
pip uninstall protobuf
pip install protobuf==3.3.0.
It works for me.