32

I know a little of Python and more than a year ago I wrote a small script, using pipenv to manage the dependencies.

The old platform was Windows 7, the current platform is Windows 10.

At that time I probably had Python 3.7 installed, now I have 3.8.3 but running:

pipenv install

Complained that:

Warning: Python 3.7 was not found on your system…
Neither 'pyenv' nor 'asdf' could be found to install Python.
You can specify specific versions of Python with:
$ pipenv --python path\to\python

This is the Pipfile

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
python-ldap = {path = "./dependencies/python_ldap-3.1.0-cp37-cp37m-win_amd64.whl"}
requests = "~=2.0"
mysqlclient = "~=1.0"

[dev-packages]

[requires]
python_version = "3.7"

I manually edited that last line to allow 3.8, but how do I properly fix that?
I think 3.7 should be a minimum requirement — well, the script is so simple that I think even 3.0 should work.

1
  • I also ran into the same issue, when I tried using a Python 3.9 docker image and the Pipenv file required Python 3.8. You can change any one of them to match, according to your requirement. Commented Dec 15, 2021 at 6:41

12 Answers 12

19
[requires]
python_version = "3.7"

and the error:

Warning: Python 3.7 was not found on your system…

Sort of hints that pipenv is installed but when it reads your config file, it sees that it should create environment with python 3.7, So, logically, you should install 3.7 or update the pipfile to use the python you have installed ?

13

I would recommend you to install pyenv (so it can manage your Python versions).

The repository of pyenv is this one: https://github.com/pyenv/pyenv

With pyenv installed when a Pipfile requires a version of Python that you do not have on your machine it will ask if you want to install it with pyenv. In this way you'll be able to work in projects with different python versions without having to worry about which version the project is using. With pyenv you can easily change between python version in your global shell as well.

Another suggestion not really realated to your question is, you should take a look on poetry to replace pipenv (it is faster because it install the dependencies in a async way), the website for poetry is this one: https://python-poetry.org/

But still, you will need something like pyenv or install another python version manually to solve your problem.

If you just wanna make the Pipfile allow you to use newer versions of python I guess you can change it like this:

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
python-ldap = {path = "./dependencies/python_ldap-3.1.0-cp37-cp37m-win_amd64.whl"}
requests = "~=2.0"
mysqlclient = "~=1.0"

[dev-packages]

[requires]
python_version = "^3.7"

I'm not really sure if the syntax is ^3.7 or >=3.7 but should be one of this two.

10

If your python command is Python 2.x, but you have a python3 command which runs Python 3.x, then you might just need to use the --python option to tell pipenv to use it:

$ pipenv install
Warning: Python >= 3.5 was not found on your system...
Neither 'pyenv' nor 'asdf' could be found to install Python.
You can specify specific versions of Python with:
$ pipenv --python path/to/python

$ pipenv --python `which python3` install
Creating a virtualenv for this project...
5

I have Python 3.9 installed,

and pipenv requires Python 3.6 as stated in pipfile.

So, I change the value in pipfile

[requires]
python_version = "3.6"

to

[requires]
python_version = "*"

so it can be work on any version.

1
3

You can download Python 3.7 from the official site - https://www.python.org/downloads/

4
  • 2
    Er, really? Should I keep two Pyhton installations just because of a script? I hope that's not the way, but that there's an option to require Python >= 3.7 (or even >= 3.x)
    – watery
    Commented Aug 4, 2020 at 13:31
  • Yeah, I needed Python 3.6 for PyAudio but I was using 3.8, I installed 3.6 and now I have both versions)
    – user14023416
    Commented Aug 4, 2020 at 13:33
  • By judging the results of the further installation steps, I think this is the way to go.
    – watery
    Commented Aug 7, 2020 at 7:49
  • 1
    Most of the package managements (such as pyenv and conda) can handle having different python versions inside the virtual environments. This doesn't seem like the best solution.
    – anishtain4
    Commented May 27, 2021 at 14:00
1

The simple solution is, you can avoid such a problem and make it a fully system dependable python version. To make this happen, just remove python_version = "3.7" line from requires.

[[source]]
url = "https://pypi.org/simple"
verify_ssl = false
name = "pypi"

[packages]

[dev-packages]

[requires]
python_version = "3.7"

So after removing the python version, your pipfile would be like,

[[source]]
url = "https://pypi.org/simple"
verify_ssl = false
name = "pypi"

[packages]

[dev-packages]

[requires]
python_version = "*"
1
  • This would allow any Python version, which is really too much. And please have a look at the linked question: you'll see that that the exact original Python version is required when installing a dependency.
    – watery
    Commented Jan 4, 2021 at 13:13
0

I had a similar problem and it was solved by deleting the pipfile. The pipfile path is the path where you enter the pipenv install command in the terminal.

1
  • 1
    The Pipfile is the file where script dependencies and other constraints are declared, so I don't think that deleting it would be the correct solution.
    – watery
    Commented Aug 6, 2022 at 12:58
0

I meet the same problem when I move my old project to a new Laptop.

Warning: Python 3.7 was not found on your system...
Neither 'pyenv' nor 'asdf' could be found to install Python.
You can specify specific versions of Python with:
$ pipenv --python path/to/python

My way to solve the problem is simply delete the old Pipfile and input pipenv shell in the terminal. Then it will build a new Pipfile and match your python as it should be.

0

You can install pyenv simply with

curl https://pyenv.run | bash

then, when you push new changes with amplify CLI, it will ask if you wish them to install the specific Python version with Pyenv. Confirm, and problem solved in a proper way :)

0

Just change this part:

[requires]
python_version = "3.7"

Set the python_version to the current version of Python in your environment

1
  • You can't do that because it physically prevents you from doing a pip download of the file.
    – Owl
    Commented Jun 17 at 17:42
0

You can either delete the Pipfile and run pipenv install your_preferred_version again so it is installed automatically, or you can just edit the python_version in the "Pipfile".

1
  • 1
    As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Jul 8, 2023 at 22:35
-1

Install Relevant version

How to check Python Version

cmd any directory>Python -v

In My case they need Python 3.8.2 But i have Python 3.8.0 version installed Due this i could not able over come this error

Once i install exact version i can able to run command

Not the answer you're looking for? Browse other questions tagged or ask your own question.