Can't install Django 2.0 by pip - python

I am building new Django app with a new version of Django.
I found Django 2.0 is available (2.0.2) https://www.djangoproject.com/download/, and now trying to install it with pip.
pip install Django==2.0.2
But it's not working for me.
Could not find a version that satisfies the requirement Django==2.0
(from versions: 1.1.3, 1.1.4, 1.2, 1.2.1, 1.2.2, 1.2.3, 1.2.4, 1.2.5,
1.2.6, 1.2.7, 1.3, 1.3.1, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.3.6, 1.3.7, 1.4, 1.4.1, 1.4.2, 1.4.3, 1.4.4, 1.4.5, 1.4.6, 1.4.7, 1.4.8, 1.4.9, 1.4.10, 1.4.11, 1.4.12, 1.4.13, 1.4.14, 1.4.15, 1.4.16, 1.4.17, 1.4.18, 1.4.19, 1.4.20, 1.4.21, 1.4.22, 1.5, 1.5.1, 1.5.2, 1.5.3, 1.5.4, 1.5.5, 1.5.6, 1.5.7, 1.5.8, 1.5.9, 1.5.10, 1.5.11, 1.5.12, 1.6, 1.6.1, 1.6.2, 1.6.3, 1.6.4, 1.6.5, 1.6.6, 1.6.7, 1.6.8, 1.6.9, 1.6.10, 1.6.11, 1.7, 1.7.1, 1.7.2, 1.7.3, 1.7.4, 1.7.5, 1.7.6, 1.7.7, 1.7.8, 1.7.9, 1.7.10, 1.7.11, 1.8a1, 1.8b1, 1.8b2, 1.8rc1, 1.8, 1.8.1, 1.8.2, 1.8.3, 1.8.4, 1.8.5, 1.8.6, 1.8.7, 1.8.8, 1.8.9, 1.8.10, 1.8.11, 1.8.12, 1.8.13, 1.8.14, 1.8.15, 1.8.16, 1.8.17, 1.8.18, 1.9a1, 1.9b1, 1.9rc1, 1.9rc2, 1.9, 1.9.1, 1.9.2, 1.9.3, 1.9.4, 1.9.5, 1.9.6, 1.9.7, 1.9.8, 1.9.9, 1.9.10, 1.9.11, 1.9.12, 1.9.13, 1.10a1, 1.10b1, 1.10rc1, 1.10, 1.10.1, 1.10.2, 1.10.3, 1.10.4, 1.10.5, 1.10.6, 1.10.7, 1.10.8, 1.11a1, 1.11b1, 1.11rc1, 1.11, 1.11.1, 1.11.2, 1.11.3, 1.11.4, 1.11.5, 1.11.6, 1.11.7, 1.11.8, 1.11.9, 1.11.10) No matching distribution found for Django==2.0
I am using python 2.7.14 and pip 9.0.1. What's wrong here?

Django 2.x is not supported using Python 2.x.
From the Django download page:
We recommend using the latest version of Python 3. The last version to
support Python 2.7 is Django 1.11 LTS.
You should use Python 3.x with Pip3:
pip3 install Django

if python3 is installed then try
pip3 install Django==2.0.2

Django 2.0 only supports Python 3.x

Same stuation is happen to me for django 2.1.2. I've tried this one below and its work fine for me.
pip3 install django==2.1.2

From the Release Notes
Python compatibility Django 2.0 supports Python 3.4, 3.5, and 3.6. We
highly recommend and only officially support the latest release of
each series. The Django 1.11.x series is the last to support Python
2.7. Django 2.0 will be the last release series to support Python 3.4. If you plan a deployment of Python 3.4 beyond the end-of-life for
Django 2.0 (April 2019), stick with Django 1.11 LTS (supported until
April 2020) instead. Note, however, that the end-of-life for Python
3.4 is March 2019.

Related

Unable to start the Python language server

I opened up Atom and This error popped up for me, I am not sure what I should do here.
It asked me to do "python -m pip install 'python-language-server[all]'" but then when I ran that. It gave me the error
Error:
ERROR: Could not find a version that satisfies the requirement pylint>=2.5.0; extra == "all" (from python-language-server[all]) (from versions: 0.15.2, 0.16.0, 0.18.0, 0.18.1, 0.19.0, 0.20.0, 0.21.0, 0.21.1, 0.21.2, 0.21.3, 0.22.0, 0.23.0, 0.24.0, 0.25.0, 0.25.1, 0.25.2, 0.26.0, 0.27.0, 0.28.0, 1.0.0, 1.1.0, 1.2.0, 1.2.1, 1.3.0, 1.3.1, 1.4.0, 1.4.1, 1.4.2, 1.4.3, 1.4.4, 1.4.5, 1.5.0, 1.5.1, 1.5.2, 1.5.3, 1.5.4, 1.5.5, 1.5.6, 1.6.0, 1.6.1, 1.6.2, 1.6.3, 1.6.4, 1.6.5, 1.7.0, 1.7.1, 1.7.2, 1.7.3, 1.7.4, 1.7.5, 1.7.6, 1.8.0, 1.8.1, 1.8.2, 1.8.3, 1.8.4, 1.9.0, 1.9.1, 1.9.2, 1.9.3, 1.9.4, 1.9.5)
ERROR: No matching distribution found for pylint>=2.5.0; extra == "all" (from python-language-server[all])
After this I tried "python -m pip install 'python-language-server'" but then this gave the error
Error:
WARNING: The script pyls is installed in '/Users/baner75418/Library/Python/2.7/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Please Help me with what I should do next also I am on macOS Big Sur.
It's a bug in python-language-server. I just reported it.
Meanwhile you can try using pip install --no-binary to install python-language-server from source distribution to work around the bug:
pip install --no-binary=python-language-server 'python-language-server[all]'

unable to pip install tensorflow (anymore)

Until recently I was able to install the tensorflow 1.5.0 package when using python 3.6.7 on windows. Now I can't and from the message "from version" below it seems that no tensorflow package is available at all.
Did the support stop recently?
Some additional information taking into account the comments from micha137 and hoefling:
In linux, tensorflow is available in many flavors. This is the case with pip version 9.0.3, 10.0.1, and 18.1 I tried.
For example:
(env3)xxx#xxx-linux:/local/mnt/workspace/tmp$ pip install tensorflow==
Collecting tensorflow==
Could not find a version that satisfies the requirement tensorflow== (from versions: 0.12.0rc0, 0.12.0rc1, 0.12.0, 0.12.1, 1.0.0, 1.0.1, 1.1.0rc0, 1.1.0rc1, 1.1.0rc2, 1.1.0, 1.2.0rc0, 1.2.0rc1, 1.2.0rc2, 1.2.0, 1.2.1, 1.3.0rc0, 1.3.0rc1, 1.3.0rc2, 1.3.0, 1.4.0rc0, 1.4.0rc1, 1.4.0, 1.4.1, 1.5.0rc0, 1.5.0rc1, 1.5.0, 1.5.1, 1.6.0rc0, 1.6.0rc1, 1.6.0, 1.7.0rc0, 1.7.0rc1, 1.7.0, 1.7.1, 1.8.0rc0, 1.8.0rc1, 1.8.0, 1.9.0rc0, 1.9.0rc1, 1.9.0rc2, 1.9.0, 1.10.0rc0, 1.10.0rc1, 1.10.0, 1.10.1, 1.11.0rc0, 1.11.0rc1, 1.11.0rc2, 1.11.0, 1.12.0rc0, 1.12.0rc1, 1.12.0rc2, 1.12.0)
No matching distribution found for tensorflow==
(env3)xxx#xxx-linux:/local/mnt/workspace/tmp$ pip --version
pip 18.1 from /local/mnt/workspace/tmp/env3/lib/python3.4/site-packages/pip (python 3.4)
By contract, in Windows:
C:\tmp>pip --version
pip 18.1 from c:\users\xxx\appdata\local\programs\python\python36-32\lib\site-packages\pip (python 3.6)
C:\tmp>pip install tensorflow==
Collecting tensorflow==
Could not find a version that satisfies the requirement tensorflow== (from versions: )
No matching distribution found for tensorflow==
Some additional information:
C:\tmp>pip install -vvv tensorflow. -
Config variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect
Config variable 'WITH_PYMALLOC' is unset, Python ABI tag may be incorrect
Created temporary directory: C:\Users\xxx\AppData\Local\Temp\pip-ephem-wheel-cache-fmlkvkla
Created temporary directory: C:\Users\xxx\AppData\Local\Temp\pip-req-tracker-oijk67__
Created requirements tracker 'C:\\Users\\xxx\\AppData\\Local\\Temp\\pip-req-tracker-oijk67__'
Created temporary directory: C:\Users\xxx\AppData\Local\Temp\pip-install-tt2d7lx0
Cleaning up...
Removed build tracker 'C:\\Users\\xxx\\AppData\\Local\\Temp\\pip-req-tracker-oijk67__'
Invalid requirement: 'tensorflow.'
Followed by a lengthy traceback.
And:
C:\tmp>python -c "from setuptools import pep425tags; print(pep425tags.get_supported()[0])"
c:\Users\xxx\AppData\Local\Programs\Python\Python36-32\lib\site-packages\setuptools\pep425tags.py:89: RuntimeWarning: Config variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect
warn=(impl == 'cp')):
c:\Users\xxx\AppData\Local\Programs\Python\Python36-32\lib\site-packages\setuptools\pep425tags.py:93: RuntimeWarning: Config variable 'WITH_PYMALLOC' is unset, Python ABI tag may be incorrect
warn=(impl == 'cp')):
('cp36', 'cp36m', 'win32')
Judging by the output of
python -c "from setuptools import pep425tags; print(pep425tags.get_supported()[0])"
('cp36', 'cp36m', 'win32')
you have the supported Python version, but a 32 bit distribution installed (the platform tag is win32; for 64 bit Python on Windows, it should be win_amd64). Tensorflow is available for 64 bit distributions only (all the wheels on PyPI have platform tag either macosx_10_11_x86_64 for MacOS, or manylinux1_x86_64 for Linux, or win_amd64 for Windows). Installing the 64 bit Python (e.g. from python-3.6.8-amd64.exe) will do the trick.
You could try to list the available versions:
$ pip.exe install tensorflow==
Collecting tensorflow==
Could not find a version that satisfies the requirement tensorflow== (from ver sions: 1.2.0rc2, 1.2.0, 1.2.1, 1.3.0rc0, 1.3.0rc1, 1.3.0rc2, 1.3.0, 1.4.0rc0, 1.4.0rc1, 1.4.0, 1.5.0rc0, 1.5.0rc1, 1.5.0, 1.5.1, 1.6.0rc0, 1.6.0rc1, 1.6.0, 1.7. 0rc0, 1.7.0rc1, 1.7.0, 1.7.1, 1.8.0rc0, 1.8.0rc1, 1.8.0, 1.9.0rc0, 1.9.0rc1, 1.9 .0rc2, 1.9.0, 1.10.0rc0, 1.10.0rc1, 1.10.0, 1.11.0rc0, 1.11.0rc1, 1.11.0rc2, 1.11.0, 1.12.0rc0, 1.12.0rc1, 1.12.0rc2, 1.12.0)
No matching distribution found for tensorflow==

Why won't pip install django 2.x?

Pip will not let me install django 2.0.7. When I execute sudo -H pip install Django==2.0.7 it says:
Could not find a version that satisfies the requirement Django==2.0.7 (from versions: 1.1.3, 1.1.4, 1.2, 1.2.1, 1.2.2, 1.2.3, 1.2.4, 1.2.5, 1.2.6, 1.2.7, 1.3, 1.3.1, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.3.6, 1.3.7, 1.4, 1.4.1, 1.4.2, 1.4.3, 1.4.4, 1.4.5, 1.4.6, 1.4.7, 1.4.8, 1.4.9, 1.4.10, 1.4.11, 1.4.12, 1.4.13, 1.4.14, 1.4.15, 1.4.16, 1.4.17, 1.4.18, 1.4.19, 1.4.20, 1.4.21, 1.4.22, 1.5, 1.5.1, 1.5.2, 1.5.3, 1.5.4, 1.5.5, 1.5.6, 1.5.7, 1.5.8, 1.5.9, 1.5.10, 1.5.11, 1.5.12, 1.6, 1.6.1, 1.6.2, 1.6.3, 1.6.4, 1.6.5, 1.6.6, 1.6.7, 1.6.8, 1.6.9, 1.6.10, 1.6.11, 1.7, 1.7.1, 1.7.2, 1.7.3, 1.7.4, 1.7.5, 1.7.6, 1.7.7, 1.7.8, 1.7.9, 1.7.10, 1.7.11, 1.8a1, 1.8b1, 1.8b2, 1.8rc1, 1.8, 1.8.1, 1.8.2, 1.8.3, 1.8.4, 1.8.5, 1.8.6, 1.8.7, 1.8.8, 1.8.9, 1.8.10, 1.8.11, 1.8.12, 1.8.13, 1.8.14, 1.8.15, 1.8.16, 1.8.17, 1.8.18, 1.8.19, 1.9a1, 1.9b1, 1.9rc1, 1.9rc2, 1.9, 1.9.1, 1.9.2, 1.9.3, 1.9.4, 1.9.5, 1.9.6, 1.9.7, 1.9.8, 1.9.9, 1.9.10, 1.9.11, 1.9.12, 1.9.13, 1.10a1, 1.10b1, 1.10rc1, 1.10, 1.10.1, 1.10.2, 1.10.3, 1.10.4, 1.10.5, 1.10.6, 1.10.7, 1.10.8, 1.11a1, 1.11b1, 1.11rc1, 1.11, 1.11.1, 1.11.2, 1.11.3, 1.11.4, 1.11.5, 1.11.6, 1.11.7, 1.11.8, 1.11.9, 1.11.10, 1.11.11, 1.11.12, 1.11.13, 1.11.14)
No matching distribution found for Django==2.0.7
As you can see above, the most recent version it can find is version 1.11.14. Normally, I would be okay with downloading that but it is not compatible with Python 3.7 (the version I have). I have also checked to make sure pip was updated to the latest version (pip 10.0.1).
Mac and Linux (and similar systems) both contain default installations (generally Python 2.7). This is accessed via python in terminal.
pip if installed will also be for Python 2.7 (or whatever it is on your system).
When you run sudo -H pip install Django==2.0.7 it points to the 2.7 installation (or your equivalent).
You can test this via the which pip command, which will show in the path where it is installing to.
As mentioned in the other answer, Django lost support for 2.7 with version 1.11.14 so you cannot install the version 2 Django since it has no support (this is your error) for Python 2.
Now to deal with the problem:
To install Django you just need to tell the terminal which interpreter to use. As mentioned you could use pip37 or I prefer to use:
python37 -m pip install Django
Simply because I use python37 command all the time so I know it will work, and will therefore install to the correct location.
Note that since you are installing Django you should probably be using a separate environment for security (venv or virtualenv).
The sudo should not be used only as an absolute last resort (as already mentioned by abccd) as it can ruin your system (I have done this multiple times in a Virtual Installation, so it is definitly something you want to avoid if possible), once again using a virtual environment would ensure that you do not need the sudo command since you are not installing in a root dictionary.
As Simon has mentioned in the comments: your sudo -H pip is installing for Python 2.7, which explains why the latest version for Django is 1.11.14 since Django 2.x dropped support for Python 2.7.
You'll need to use Python 3.7's pip, run either one of the following:
pip3 install --user django
python37 install --user django
python3 install --user django
pip37 install --user django
You REALLY shouldn't use pip with sudo (it's not safe).
Adding to above answers, if you are using a virtual environment, make sure you are using Python3 to create it. You can explicitly do that like this :
virtualenv -p C:\Python36\python3.exe VE_Project
Activate the env . Now if you do a "pip install Django" , it will install the latest in 2.x series.

Google API Core Library and Python version requirements

I'm using pipenv on a project with Python 3.6.4 and when installing dependencies I receive this error:
Could not find a version that matches futures>=3.2.0
Tried: 0.2.python3, 0.1, 0.2, 1.0, 2.0, 2.1, 2.1.1, 2.1.2, 2.1.3, 2.1.4, 2.1.5, 2.1.5, 2.1.6, 2.1.6, 2.2.0, 2.2.0, 3.0.0, 3.0.0, 3.0.1, 3.0.1, 3.0.2, 3.0.2, 3.0.3, 3.0.3, 3.0.4, 3.0.4, 3.0.5, 3.0.5, 3.1.0, 3.1.0, 3.1.1, 3.1.1
After running pipenv lock -v I can see that google-api-core is a secondary dependency and it requires the following:
google-api-core==0.1.4 requires futures>=3.2.0; python_version < "3.2", google-auth<2.0.0dev,>=0.4.0, googleapis-common-protos<2.0dev,>=1.5.3, protobuf>=3.0.0, pytz, requests<3.0.0dev,>=2.18.0, setuptools>=34.0.0, six>=1.10.0
Does this mean that google-api-core requires the outdated Python 3.2?

Installing TensorFlow with Pip Python on Windows

Last month they released tensor-flow comparability with windows. Looking at the docs I've installed python 3.6 and run
pip install tensorflow-gpu
but it doesn't find it and therefore doesn't install it.
could not find a version that satisfies the requirements tensorflow-gpu(from versions)
Am I missing something basic? How can I fix or circumvent this?
A stable release of Python 3.6 for Windows became available on 12/23/2016, and we have not yet built TensorFlow packages for that version. (We will look into doing this after the holidays.) For now, your best options are:
Downgrade to Python 3.5 (64-bit version), which the pre-built packages support.
Try building TensorFlow from source.
Here is what i did to get tensorflow working with windows.
Download python 3.5.0 (64 bit from Python Releases for Windows)
Install it and check python version by running below command in cmd:
python --version
Python 3.5.0
Then run below command to upgrade pip to latest
python -m pip install --upgrade pip
Now install tensorflow using pip
pip install tensorflow
That's it you have installed tensorflow on windows. Below image shows what happens when you type above commands
Example to verify tensorflow is working.
$ python
...
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))
I think you have to install Python 3.5 not 3.6. I'm having the same problem.
pip3 install tensorflow==tensorflow_version
Available tensorflow versions: (0.12.1, 1.0.0, 1.0.1, 1.1.0rc0, 1.1.0rc1, 1.1.0rc2, 1.1.0, 1.2.0rc0, 1.2.0rc1, 1.2.0rc2, 1.2.0, 1.2.1, 1.3.0rc0, 1.3.0rc1, 1.3.0rc2, 1.3.0, 1.4.0rc0, 1.4.0rc1, 1.4.0, 1.4.1, 1.5.0rc0, 1.5.0rc1, 1.5.0, 1.5.1, 1.6.0rc0, 1.6.0rc1, 1.6.0, 1.7.0rc0, 1.7.0rc1, 1.7.0, 1.7.1, 1.8.0rc0, 1.8.0rc1, 1.8.0, 1.9.0rc0, 1.9.0rc1, 1.9.0rc2, 1.9.0, 1.10.0rc0, 1.10.0rc1, 1.10.0, 1.10.1, 1.11.0rc0, 1.11.0rc1, 1.11.0rc2, 1.11.0, 1.12.0rc0, 1.12.0rc1, 1.12.0rc2, 1.12.0, 1.12.2, 1.12.3, 1.13.0rc0, 1.13.0rc1, 1.13.0rc2, 1.13.1, 1.13.2, 1.14.0rc0, 1.14.0rc1, 1.14.0, 2.0.0a0, 2.0.0b0, 2.0.0b1)

Categories

Resources