I need to install TensorFlow with pip3, when it gets to the installing NumPy step it stops and gives me the error:
(When I tried to install NumPy with pip it was fine, but I need it to work with python 3.)
Thanks in advance for any help.
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-v32qiaml/numpy/setup.py", line 68
f"NumPy {VERSION} may not yet support Python "
^
SyntaxError: invalid syntax
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-v32qiaml/numpy/```
F-strings were added to Python at version 3.6. It seems your pip3 runs under earlier Python, perhaps 3.5.
Check your pip and pip3 (and their interpreters) versions with pip --version and pip3 --version. Install more recent Python version if needed.
Related
I've recently decided to learn OpenGl in python.
I installed PyOpenGL using pip3 install PyOpenGl PyOpenGl_accelerate. I was then about to follow a
tutorial for PyOpenGL. The first item was to install PyOpenGLContext.
I tried to install PyOpenGLContext with both pip3 install OpenGLContext and pip3 install PyDispatcher PyVRML97 OpenGLContext and both gave me the same error:
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/3r/xfny397j6j98y1sjgh_s574m0000gn/T/pip-build-o7zx54vx/OpenGLContext/setup.py", line 10
except ImportError, err:
^
SyntaxError: invalid syntax
So, there's a syntax error there. How do I get around this? If you need more information, please let me know. I am trying to install this on a MacBook Pro (2013) version for Python3.5.
It should work if you download and install the wheel from Unofficial Windows Binaries for Python Extension Packages:
Download the OpenGLContext‑2.3.0‑py2.py3‑none‑any.whl installation file to a an arbitrary directory.
cd to that directory in a command line and install using pip install OpenGLContext‑2.3.0‑py2.py3‑none‑any.whl
It looks like OpenGLContext has not been updated in a while, and thus is not compatible with Python 3.5.
Having a look at https://pypi.python.org/pypi/OpenGLContext yields that the last update was in 2014.
You probably want to either use an older python version, or a different library.
I have installed Anaconda 2.5 and used spyder with Python2.7 for sometime. I used pdfminer those days. Then I wanted to use Python3.6. So I have uninstalled Anaconda and installed Anaconda3.5. And there is no problem in using Python3.5 and I used more packages too. But now am trying to install pdfminer. Am getting some errors.
Using cached https://files.pythonhosted.org/packages/57/4f/e1df0437858188d2d36466a7bb89aa024d252bd0b7e3ba90cbc567c6c0b8/pdfminer-20140328.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\PRIYA~1.MUT\AppData\Local\Temp\pip-install-fzctx8lo\pdfminer\setup.py",line 3, in <module>
from pdfminer import __version__
File "C:\Users\PRIYA~1.MUT\AppData\Local\Temp\pip-install-fzctx8lo\pdfminer\pdfminer\__init__.py", line 5
print __version__
^
`SyntaxError: Missing parentheses in call to 'print'. Did you mean print(__version__)?`
I knew there is some issues because print __version__ needs to be like print (__version__). but I don't know where I need to edit. And this path
"C:\Users\PRIYA~1.MUT\AppData\Local\Temp\pip-install-fzctx8lo\pdfminer\pdfminer__init__.py"
doesn't exist on my system.Kindly help me in solving this.
I manually downloaded pdfminer-20140328.tar.gz from the link https://pypi.org/project/pdfminer/ and tried to install it using the command pip install -e <path>. But I got the same error. Then I have opened the pdfminer__init__.py file and edited accordingly to Python3.6. I have no idea why pdfminer package doesn't support Python3.6 directly. Eventhough installed, there is some dependency error. So I can't use that in Python3.6.
I have been trying to install numpy for Python 2.7.12 on a ubuntu 16.04 machine, but am not sure I am doing the right thing.
I issued the command
python setup.py install
and received the following error message:
ImportError: No module named Cython.Compiler.Main
So I have also been trying to install the cython package and received another error message:
/Cython-0.28.1/Cython/Plex/Scanners.c:19:20: fatal error: Python.h: No such file or directory
I thought this problem required me to install cpython. Trying to install this resulted in the following error message:
Traceback (most recent call last):
File "setup.py", line 4, in <module>
import sys, os, importlib.machinery, re, optparse
ImportError: No module named machinery
I am somewhat stumped about how to continue. Am I on the right path? Is there a different way I could try (the computer in question cannot connect to the internet)?
You can check if pip is install thanks to the command which pip,
in my case :
$ which pip
/home/usr1/anaconda3/bin/pip
If pip is not install install it : instruction here
then you should be able to use it such as :
pip install numpy
an alternative is to use : conda install
In the terminal use:
pip install numpy
If you get any error like 'permission denied', try:
sudo pip install numpy
I'm new to Python and I've been trying to start a Discord bot on my computer, but whenever I try to install sudo pip install discord.py I get the following error:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-QOFKFs/aiohttp/setup.py", line 60, in <module>
raise RuntimeError("aiohttp requires Python 3.4.2+")
RuntimeError: aiohttp requires Python 3.4.2+
I'm running Linux Mint 18.2 and I'm almost 100% positive I've got Python and Pip up to date.
Have you check pip is really pip for python3 and python's version?
You could using pip for python2.
Like this link
Installed Python 3.5.1 on Mac. When I try to download a module from Python's standard library such as pip install BeautifulSoup, I receive the error below:
Collecting BeautifulSoup
Using cached BeautifulSoup-3.2.1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
File "/private/var/folders/bz/2h0jcnq54pzcvjp2x0mhrc6r0000gn/T/pip-build-b_z00926/BeautifulSoup/setup.py", line 22
print "Unit tests have failed!"
^
SyntaxError: Missing parentheses in call to 'print'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/bz/2h0jcnq54pzcvjp2x0mhrc6r0000gn/T/pip-build-b_z00926/BeautifulSoup/
That appears to be an old version of BeautifulSoup. Try this instead:
pip install beautifulsoup4
the missing parentheses part might suggest that pip uses python2 by default when you actually need python3
a simple workaround:
python3 -m pip install beautifulsoup # or beautifulsoup4
that has the same effect as pip install, but explicitly specifies which python to use
Try using pip2 (for Python 2) or pip3 (for Python 3) instead of just pip. It might be using the wrong version of pip for the Python version you are trying to use.