-2

I am very new to Python. I am trying to install a library called Mesa (https://mesa.readthedocs.io/en/master/index.html) in a virtual environment, but each time I try to clone the repository I get the error message: An error occurred while installing pandas==1.2.4

I believe the problem is that I have installed Python 3.9, but Mesa works with Python 3.7. I have installed Python 3.7 on my computer also, but do not know how to make a virtual environment which runs Python 3.7.

I have virtualenv installed but this is as far as I have gotten... very specific answers would be much appreciated as I still don't really know what I am doing!

  • try pipenv https://pipenv.pypa.io/en/latest/, then you can do `pipenv --python 3.6 ` – Epsi95 Jul 09 '21 at 14:50
  • Normally the `python` commands maps to the latest Python version installed in your system, but you can still explicitly access older Python versions if you add the version number, e.g. `python3.7 -m pip install ...` or `python3.7 -m virtualenv ...`. – jfaccioni Jul 09 '21 at 14:53
  • https://github.com/pyenv/pyenv should solve the issue. "pyenv lets you easily switch between multiple versions of Python. It's simple, unobtrusive, and follows the UNIX tradition of single-purpose tools that do one thing well." – Paolo Jul 09 '21 at 14:53
  • https://stackoverflow.com/search?q=%5Bvirtualenv%5D+different+python+version – phd Jul 09 '21 at 16:30

2 Answers2

2

From my experience the easiest way is using Anaconda and creating environments with specific versions inside it. https://www.anaconda.com/

The second way I use is google colab its really fast if I just want to check something on different version and requires no setup just lunch it from your google account

Piotr Nowakowski
  • 376
  • 1
  • 11
0
With python3.8:- virtualenv -p python3.8 env_name
replace python version like python3.9, python3.7..
Asif Akhtar
  • 323
  • 3
  • 14