Hey ,
I work with pipenv on a daily basis, I feel confident I can help you with this issue.
I realised that the virtual environment required python3.11.0
No, technically, pipenv requires 3.8 or greater.
Question: what’s the difference between python and python3 when entering the python interpreter?
The Python3 command was introduced because the python command pointed to python2. Since then, Python3 has become the default and thus python points to python3 on most but not all systems. So in other words, if you just have Python 3 + on your machine, and not Python 2, you can use Python , if you have both you will use Python3, Does this makes sense?
Specifying Versions of Python
How do I control which versions they choose?
By default, Pipenv will initialize a project using whatever version of python the system has as default. To create a new virtualenv, using a specific version of Python you have installed (and on your PATH
), use the --python VERSION
flag, like so:
Use Python 3:
pipenv --python 3
Use Python3.6:
pipenv --python 3.6
Use Python 2.7.14:
pipenv --python 2.7.14
When given a Python version, like this, Pipenv will automatically scan your system for a Python that matches that given version.
Please note: To do this, the specific version of Python you want to use must be installed, and on your PATH!
Specifying Versions of a Package
Likewise, you can specify versions of packages as well. For example, to install requests you can use:
pipenv install requests~=1.2
This will update your Pipfile to reflect this requirement, automatically.
Example of Pipenv Workflow
These are the steps to follow when working with pipenv:
- Install from Pipfile, if there is one:
pipenv install
Or, add a package to your new project
pipenv install <package>
This will create a Pipfile if one doesn’t exist. If one does exist, it will automatically be edited with the new package you provided.
- Next, activate the Pipenv shell
pipenv shell
To run a python script in pipenv :
python <filename.py>
Also, this is my first time using the forums, so excuse my ignorance if you are not supposed to ask new questions within questions
My friend, please feel free to ask any question you like ~ this is how we learn! Let me know if my explanation answered your questions. If you need further assistance with anything, please let me know!
Best regards,