Tensorflow installation - Double requirement given - python-3.x

I got the following error when installing tensorflow using the command:
sudo pip3 install --upgrade $TF_BINARY_URL
I also tried without the --upgrade but to no avail:
sudo pip3 install $TF_BINARY_URL
The environment variable / OS / Python / CUDA Toolkit / CuDNN as obtained from the tensorflow install instructions:
# Ubuntu/Linux 64-bit, GPU enabled, Python 3.4
# Requires CUDA toolkit 7.5 and CuDNN v4. For other versions, see "Install from sources" below.
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.9.0rc0-cp34-cp34m-linux_x86_64.whl
The error message is:
Double requirement given: tensorflow==0.9.0rc0 from https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.9.0rc0-cp34-cp34m-linux_x86_64.whl (already in tensorflow, name='tensorflow')
Here is the ~/.pip/pip.log:
/usr/bin/pip3 run on Wed Jun 15 23:13:09 2016
Downloading/unpacking https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.9.0rc0-cp34-cp34m-linux_x86_64.whl
Downloading from URL https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.9.0rc0-cp34-cp34m-linux_x86_64.whl
Cleaning up...
Removing temporary dir /tmp/pip_build_root...
Double requirement given: tensorflow==0.9.0rc0 from https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.9.0rc0-cp34-cp34m-linux_x86_64.whl (already in tensorflow, name='tensorflow')
Exception information:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 278, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/usr/lib/python3/dist-packages/pip/req.py", line 1263, in prepare_files
self.add_requirement(req_to_install)
File "/usr/lib/python3/dist-packages/pip/req.py", line 989, in add_requirement
% (install_req, self.get_requirement(name), name))
pip.exceptions.InstallationError: Double requirement given: tensorflow==0.9.0rc0 from https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.9.0rc0-cp34-cp34m-linux_x86_64.whl (already in tensorflow, name='tensorflow')
I have googled and checked the other SO questions for this installation issue but did not find anything related. I will be happy to provide any other environment information necessary for debugging this.

Related

Installing pygame fails on local file [duplicate]

This question already has answers here:
Cannot install pygame in Pycharm
(1 answer)
pycharm doesn't recognize pygame package
(2 answers)
Make sure that you use the correct version of 'pip' installed for your Python interpreter located at 'dir:\projectPath\venv\Scripts\python.exe'
(8 answers)
Closed 2 years ago.
I am trying for a while now to install pygame into my Project but whatever I try is doesn’t work. The real frustrating part is that I managed to do it in the past. Witch might be the problem, but I am getting ahead of myself.
Environment:
Python 3.8
Windows 10
I use PyCharm
pip install pygame
i get:
Collecting pygame
Using cached
https://files.pythonhosted.org/packages/0f/9c/78626be04e193c0624842090fe5555b3805c050dfaa81c8094d6441
db2be/pygame-1.9.6.tar.gz
Complete output from command python setup.py egg_info:
WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
Using WINDOWS configuration...
Download prebuilts to "prebuilt_downloads" and copy to "./prebuilt-x64"? [Y/n]Traceback (most
recent call last):
File "<string>", line 1, in <module>
File "C:\Users\User\AppData\Local\Temp\pip-install-la9vy5w2\pygame\setup.py", line 194, in
<module>
buildconfig.config.main(AUTO_CONFIG)
File "C:\Users\User\AppData\Local\Temp\pip-install-la9vy5w2\pygame\buildconfig\config.py", line
210, in main
deps = CFG.main(**kwds)
File "C:\Users\User\AppData\Local\Temp\pip-install-la9vy5w2\pygame\buildconfig\config_win.py",
line 576, in main
and download_win_prebuilt.ask(**download_kwargs):
File "C:\Users\User\AppData\Local\Temp\pip-install-
la9vy5w2\pygame\buildconfig\download_win_prebuilt.py", line 302, in ask
reply = raw_input(
EOFError: EOF when reading a line
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\User\AppData\Local\Temp\pip-
install-la9vy5w2\pygame\
I fould someone else who had the sme problem here:
Pip Install EOFError
and also:
Unable to install pygame on Python 3.8 via pip (Windows 10)
So I tried:
pip install pygame==2.0.0.dev6
I got:
Collecting pygame==2.0.0.dev6
Using cached
https://files.pythonhosted.org/packages/c5/a0/63f9ca836e6a08e560f1ef3f2535ffb46bfdad2abb093dd097dae25
2be28/pygame-2.0.0.dev6.tar.gz
Complete output from command python setup.py egg_info:
WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
Using WINDOWS configuration...
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\User\AppData\Local\Temp\pip-install-uf_w85qw\pygame\setup.py", line 258, in
<module>
buildconfig.config.main(AUTO_CONFIG)
File "C:\Users\User\AppData\Local\Temp\pip-install-uf_w85qw\pygame\buildconfig\config.py", line
208, in main
deps = CFG.main(**kwds)
File "C:\Users\User\AppData\Local\Temp\pip-install-uf_w85qw\pygame\buildconfig\config_win.py", line 559, in main
and download_win_prebuilt.ask(**download_kwargs):
File "C:\Users\User\AppData\Local\Temp\pip-install-uf_w85qw\pygame\buildconfig\download_win_prebuilt.py", line 269, in ask
update(x86=x86, x64=x64, sdl2=sdl2)
File "C:\Users\User\AppData\Local\Temp\pip-install-uf_w85qw\pygame\buildconfig\download_win_prebuilt.py", line 252, in update
download_prebuilts(download_dir, x86=x86, x64=x64, sdl2=sdl2)
File "C:\Users\User\AppData\Local\Temp\pip-install-uf_w85qw\pygame\buildconfig\download_win_prebuilt.py", line 101, in download_prebuilts
download_sha1_unzip(url, checksum, temp_dir, 1)
File "C:\Users\User\AppData\Local\Temp\pip-install-uf_w85qw\pygame\buildconfig\download_win_prebuilt.py", line 17, in download_sha1_unzip
import requests
ModuleNotFoundError: No module named 'requests'
Making dir :prebuilt_downloads:
---
For help with compilation see:
https://www.pygame.org/wiki/CompileWindows
To contribute to pygame development see:
https://www.pygame.org/contribute.html
---
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\User\AppData\Local\Temp\pip-install-uf_w85qw\pygame\
I also tried some other stuff, like updating pip, but in the end I ended up with the same error message again. (If us want to see the full log just say it and I will upload the other 2 pages of error message.)
Am I right in my assumption that pip tries to install the game from a local file and that file is somehow corrupted or something?
If so how can I make pip install the packed form the Internet?
If not what is the problem?
I can even life with some weird solution like coping a entire project including its packages. (ok that would bug me a little, but as long as it works ...)
Since it was suggested to me I tried
pip install requests
in a new project:
Collecting requests
Using cached
https://files.pythonhosted.org/packages/45/1e/0c169c6a5381e241ba7404532c16a21d86ab872c9bed8bdcd4c423954103/requests-2.24.0-py2.py3-none-any.whl
Collecting chardet<4,>=3.0.2 (from requests)
Using cached
https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl
Collecting certifi>=2017.4.17 (from requests)
Using cached
https://files.pythonhosted.org/packages/5e/c4/6c4fe722df5343c33226f0b4e0bb042e4dc13483228b4718baf286f86d87/certifi-2020.6.20-py2.py3-none-any.whl
Collecting idna<3,>=2.5 (from requests)
Using cached
https://files.pythonhosted.org/packages/a2/38/928ddce2273eaa564f6f50de919327bf3a00f091b5baba8dfa9460f3a8a8/idna-2.10-py2.py3-none-any.whl
Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 (from requests)
Using cached
https://files.pythonhosted.org/packages/9f/f0/a391d1463ebb1b233795cabfc0ef38d3db4442339de68f847026199e69d7/urllib3-1.25.10-py2.py3-none-any.whl
Installing collected packages: chardet, certifi, idna, urllib3, requests
Successfully installed certifi-2020.6.20 chardet-3.0.4 idna-2.10 requests-2.24.0 urllib3-1.25.10
and than:
pip install pygame==2.0.0.dev6
leading to:
Collecting pygame==2.0.0.dev6
Using cached https://files.pythonhosted.org/packages/c5/a0/63f9ca836e6a08e560f1ef3f2535ffb46bfdad2abb093dd097dae252be28/pygame-2.0.0.dev6.tar.gz
Complete output from command python setup.py egg_info:
WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
Using WINDOWS configuration...
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\User\AppData\Local\Temp\pip-install-ccq77zry\pygame\setup.py", line 258, in <module>
buildconfig.config.main(AUTO_CONFIG)
File "C:\Users\User\AppData\Local\Temp\pip-install-ccq77zry\pygame\buildconfig\config.py", line 208, in main
deps = CFG.main(**kwds)
File "C:\Users\User\AppData\Local\Temp\pip-install-ccq77zry\pygame\buildconfig\config_win.py", line 559, in main
and download_win_prebuilt.ask(**download_kwargs):
File "C:\Users\User\AppData\Local\Temp\pip-install-ccq77zry\pygame\buildconfig\download_win_prebuilt.py", line 269, in ask
update(x86=x86, x64=x64, sdl2=sdl2)
File "C:\Users\User\AppData\Local\Temp\pip-install-ccq77zry\pygame\buildconfig\download_win_prebuilt.py", line 252, in update
download_prebuilts(download_dir, x86=x86, x64=x64, sdl2=sdl2)
File "C:\Users\User\AppData\Local\Temp\pip-install-ccq77zry\pygame\buildconfig\download_win_prebuilt.py", line 101, in download_prebuilts
download_sha1_unzip(url, checksum, temp_dir, 1)
File "C:\Users\User\AppData\Local\Temp\pip-install-ccq77zry\pygame\buildconfig\download_win_prebuilt.py", line 37, in download_sha1_unzip
raise ValueError(
ValueError: url:https://bitbucket.org/llindstrom/pygame/downloads/prebuilt-x64-pygame-1.9.2-20150922.zip should have checksum:3a5af3427b3aa13a0aaf5c4cb08daaed341613ed: Has:9571d3c5ad8347afb0b101bc242ef5da1a46bb11:
Making dir :prebuilt_downloads:
Downloading... https://www.libsdl.org/release/SDL2-devel-2.0.10-VC.zip 0bbac0106358dc99b8ba2401ae6a1c10d3927ca9
Unzipping :prebuilt_downloads\SDL2-devel-2.0.10-VC.zip:
Downloading... https://www.libsdl.org/projects/SDL_image/release/SDL2_image-devel-2.0.5-VC.zip 137f86474691f4e12e76e07d58d5920c8d844d5b
Unzipping :prebuilt_downloads\SDL2_image-devel-2.0.5-VC.zip:
Downloading... https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-devel-2.0.14-VC.zip c64d90c1f7d1bb3f3dcfcc255074611f017cdcc4
Unzipping :prebuilt_downloads\SDL2_ttf-devel-2.0.14-VC.zip:
Downloading... https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-devel-2.0.4-VC.zip 9097148f4529cf19f805ccd007618dec280f0ecc
Unzipping :prebuilt_downloads\SDL2_mixer-devel-2.0.4-VC.zip:
Downloading... https://www.ijg.org/files/jpegsr9c.zip 9ca086c960ffc4bff821ba194c8d0a15f69eae09
Unzipping :prebuilt_downloads\jpegsr9c.zip:
Downloading... https://bitbucket.org/llindstrom/pygame/downloads/prebuilt-x64-pygame-1.9.2-20150922.zip 3a5af3427b3aa13a0aaf5c4cb08daaed341613ed
---
For help with compilation see:
https://www.pygame.org/wiki/CompileWindows
To contribute to pygame development see:
https://www.pygame.org/contribute.html
---
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in
C:\Users\User\AppData\Local\Temp\pip-install-ccq77zry\pygame\
here:
https://github.com/googleapis/google-cloud-python/issues/3884
I found the advice to use:
pip install --upgrade setuptools
witch lead to:
Collecting setuptools
Downloading
https://files.pythonhosted.org/packages/6d/ed/52e05469314a266f68d9f251a8c1ab7a21a03327b1724056e3eea654bfd1/setuptools-50.0.3-py3-none-any.whl (784kB)
100% |████████████████████████████████| 788kB 1.2MB/s
Installing collected packages: setuptools
Found existing installation: setuptools 40.8.0
Uninstalling setuptools-40.8.0:
Could not install packages due to an EnvironmentError: [WinError 32] Der Prozess kann nicht auf die Datei zugreifen, da sie von einem anderen Prozess verwendet wird: 'd:\\workspace\\pycharmprojects\\libs5\\testproject\\venv\\lib\\site-packages\\setuptools-40.8.0-py3.8
.egg'
Consider using the `--user` option or check the permissions.
so i tried:
pip install --upgrade setuptools --user
witch worked:
Collecting setuptools
Using cached
https://files.pythonhosted.org/packages/6d/ed/52e05469314a266f68d9f251a8c1ab7a21a03327b1724056e3eea654bfd1/setuptools-50.0.3-py3-none-any.whl
Installing collected packages: setuptools
Successfully installed setuptools-50.0.3
sadly this did not change the Error message.

I tried pip installing spyder terminal in windows and now spyder 4.1.3 won't open

I have used matlab, but I am only 2 weeks into Python. I downloaded anaconda 3.7 and am using spyder 4.1.3. I was following a youtube tutorial on python. I was doing well until the guy access the cmd prompt (I use Windows 10) from within his IDE.
I didn't know how to so I googled it and to do so I found on pypi.org that all I had to do was run pip install spyder-terminal in the cmd prompt. I tried this but at the end it said that I had a permissions error and to try the --user option. I copied and pasted the exact error and saw on git hub, to create an environment or run python -m pip install --user [INSERT PACKAGE NAME].
I don't really understand hat an environment is so I did the second --user way. I ran python -m pip install --user spyder terminal I got an error about a location not being in the path variable, so i just copied the file location that it referenced and copied it the the path. I then went to open up spyder 4.1.3 and i got the error
Traceback (most recent call last):
File "C:\Users\Aaron\anaconda3\lib\site-packages\qtpy\__init__.py", line 204, in
from PySide import __version__ as PYSIDE_VERSION # analysis:ignore
ModuleNotFoundError: No module named 'PySide'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Aaron\anaconda3\Scripts\spyder-script.py", line 10, in
sys.exit(main())
File "C:\Users\Aaron\anaconda3\lib\site-packages\spyder\app\start.py", line 201, in main
from spyder.app import mainwindow
File "C:\Users\Aaron\anaconda3\lib\site-packages\spyder\app\mainwindow.py", line 53, in
requirements.check_qt()
File "C:\Users\Aaron\anaconda3\lib\site-packages\spyder\requirements.py", line 41, in check_qt
import qtpy
File "C:\Users\Aaron\anaconda3\lib\site-packages\qtpy\__init__.py", line 210, in
raise PythonQtError('No Qt bindings could be found')
qtpy.PythonQtError: No Qt bindings could be found"
I tried opening it again and got the same error. I then tried uninstalling an dre-installing spyder in the anaconda navigator and got the same error. I tried removing the location I added to path and running "pip uninstall spyder-terminal", it said it was removed and I go the same error.
If possible, I am seeking specific steps in layman's terms, because all my knowledge thus far has come from the first 2 hours of a "cool things in python" type video.

No module named 'torch' or 'torch.C'

Would appreciate an explanation like I'm 5 simply because I have checked all relevant answers and none have helped.
I have installed Python.
I have installed Pycharm.
I have installed Anaconda.
I have installed Microsoft Visual Studio.
I have not installed the CUDA toolkit.
In Anaconda, I used the commands mentioned on Pytorch.org (06/05/18)
conda install pytorch -c pytorch
pip3 install torchvision
Both have downloaded and installed properly, and I can find them in my Users/Anaconda3/pkgs folder, which I have added to the Python path.
Trying to enter
import torch
in the Python console proved unfruitful - always giving me the same error,
No module named 'torch'
I have also tried using the Project Interpreter to download the Pytorch package. It worked for numpy (sanity check, I suppose) but told me to go to Pytorch.org when I tried to install the "pytorch" or "torch" packages.
When trying to use the console in PyCharm, pip3 install codes (thinking maybe I need to save the packages into my current project, rather than in the Anaconda folder) return me an error message saying
torch-0.4.0-cp35-cp35m-win_amd64.whl is not a supported wheel on this
platform.
The same message shows no matter if I try downloading the CUDA version or not, or if I choose to use the 3.5 or 3.6 Python link (I have Python 3.7)
Currently the closest I have gotten to a solution, is manually copying the "torch" and "torch-0.4.0-py3.6.egg-info" folders into my current Project's lib folder.
However, when I do that and then run "import torch" I received the following error:
Traceback (most recent call last):
File "", line 1, in
File "C:\Program Files\JetBrains\PyCharm Community Edition 2018.1.2\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 19, in do_import
module = self._system_import(name, *args, **kwargs) File "C:\Users\Michael\PycharmProjects\Pytorch_2\venv\lib\site-packages\torch__init__.py",
line 78, in
from torch._C import *
File "C:\Program Files\JetBrains\PyCharm Community Edition 2018.1.2\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 19, in do_import
module = self._system_import(name, *args, **kwargs) ModuleNotFoundError: No module named 'torch._C'
pip uninstall torch
then
pip install torch worked for me.
I encountered the same problem because I updated my python from 3.5 to 3.6 yesterday. I think the connection between Pytorch and Python is not correctly changed. Thus, I installed Pytorch for 3.6 again and the problem is solved.
Check the install command line here[1].

Installing cx_oracle 5.2 in python 3.4.3 fails

I'm trying to install cx_oracle in my python 3.4.3 on CentOS via pip, but it fails.
$ sudo pip3.4 install cx_oracle
Collecting cx-oracle
Using cached cx_Oracle-5.2.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 20, in <module>
File "/tmp/pip-build-m0e47l0_/cx-oracle/setup.py", line 168, in <module>
instantClientRPMLib = FindInstantClientRPMLib()
File "/tmp/pip-build-m0e47l0_/cx-oracle/setup.py", line 130, in FindInstantClientRPMLib
versions.sort(key = lambda x: [int(s) for s in x.split(".")])
File "/tmp/pip-build-m0e47l0_/cx-oracle/setup.py", line 130, in <lambda>
versions.sort(key = lambda x: [int(s) for s in x.split(".")])
File "/tmp/pip-build-m0e47l0_/cx-oracle/setup.py", line 130, in <listcomp>
versions.sort(key = lambda x: [int(s) for s in x.split(".")])
ValueError: invalid literal for int() with base 10: '2_encryption_required'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-m0e47l0_/cx-oracle
Any idea?
Setuptools is already up-to-date:
$ sudo pip3.4 install --upgrade setuptools
Requirement already up-to-date: setuptools in /usr/lib/python3.4/site-packages
Oracle client is installed and happily used from PHP and others
$ echo $ORACLE_HOME
/usr/lib/oracle/11.2/client64
$ echo $LD_LIBRARY_PATH
/usr/lib/oracle/11.2/client64/lib
Well, the issue was caused by having a '/usr/lib/oracle/11.2/client64/11.2_encryption_required' folder with an Oracle client where encryption was mandated.
Unfortunately in Oracle client you need to have a separate client if you want to use encryption for some of the connections you make and not for some of the other ones.
It seems that the cx_oracle installes's FindInstantClientRPMLib wasn't prepared to see any non-numerical values, so it failed on the "encryption_required" part.
Temporarily I have renamed the folder and then the installer error did go away.

Using virtualenv with python3 in openSuSE

I am experiencing a problem when using virtualenv in openSuSE 12.3 with Python3:
I installed the python3 and python3-devel packages.
Then I installed the newest distribute and pip and finally virtualenv using pip.
When I try to create a virtualenv I get the following error:
$ virtualenv-3.3 venv01
Using base prefix '/usr'
New python executable in venv01/bin/python3.3
Also creating executable in venv01/bin/python
Installing distribute.........................................................................................................................................................................................................................................................................................................................................................................................................done.
Installing pip....
Complete output from command /home/user/venv01/bin/python3.3 -x /home/user/venv01/bin/easy_install /usr/local/lib/pytho...ort/pip-1.3.1.tar.gz:
/home/user/venv01/bin/python3.3: can't open file '/home/user/venv01/bin/easy_install': [Errno 2] No such file or directory
----------------------------------------
...Installing pip...done.
Traceback (most recent call last):
File "/usr/local/bin/virtualenv-3.3", line 9, in <module>
load_entry_point('virtualenv==1.9.1', 'console_scripts', 'virtualenv-3.3')()
File "/usr/local/lib/python3.3/site-packages/virtualenv.py", line 979, in main
no_pip=options.no_pip)
File "/usr/local/lib/python3.3/site-packages/virtualenv.py", line 1094, in create_environment
install_pip(py_executable, search_dirs=search_dirs, never_download=never_download)
File "/usr/local/lib/python3.3/site-packages/virtualenv.py", line 667, in install_pip
filter_stdout=_filter_setup)
File "/usr/local/lib/python3.3/site-packages/virtualenv.py", line 1057, in call_subprocess
% (cmd_desc, proc.returncode))
OSError: Command /home/user/venv01/bin/python3.3 -x /home/user/venv01/bin/easy_install /usr/local/lib/pytho...ort/pip-1.3.1.tar.gz failed with error code 2
Running it with -vvv yields some interesting output that shows that distribute
is extracted to <venv>/local/lib/python3.3/site-packages/.
I wonder why distribute is not installed into <venv>/lib/python3.3/site-packages/?
Does anyone have an idea why this happens and how I can use virtualenv in
openSuSE without compiling python3 myself?
[now fixed in latest patches from opensuse]
[oh! i just realised you are the same person as the original link. sorry. but i will leave this as it is a top result for google search on this issue (was searching myself for any update) so it may help others.]
this is a known issue, discussed at https://forums.opensuse.org/english/get-technical-help-here/applications/484475-using-virtualenv-python-3-a.html and with an open bug at https://bugzilla.novell.com/show_bug.cgi?id=809831
the only work-around i know of is to install everything yourself. it's not so hard, and i describe what is necessary at http://www.acooke.org/cute/GettingPyt0.html
basically:
install python 3.3 from source (do an "altinstall" to install as /usr/local/bin/python3.3)
fix the lib issue (link lib_dynload from /usr/local/lib64/python3.3 to /usr/local/lib/python3.3)
install distutils
install virtualenv
then you can use python3.3 and virtual-env-3.3 etc as expected.

Resources