Forums

This virtualenv seems to have the wrong Python version (3.8 instead of 3.9).

Normally I would figure I've done something wrong in the Virtual Environment setup but in this case

django3) 20:02 ~/django_projects/mysite $ python -V Python 3.9.5

and I've tried to set the Web refresh page to both 3.8 and 3.9 and in both cases the reset returns the error message in the title.

I've created my environment, dropped the environment by deleting everything, and recreated the environment and still get this error. I'm tempted to drop the whole thing again the just use Python 3.8 as it hardly matters for my project (going through the Django For Everybody course). However, this issue is burning my allotment of CPU and a day of my time so I'm both miffed and confused.

I've checked the forum topics on 'This virtualenv seems to have the wrong Python version' and there is no additional help but to recreate the environment. Which... of course... I've done.

Thanks guys.

If you're getting that error, it means that your virtualenv is 3.8 instead of 3.9. Are you sure that the virtualenv that you're inspecting in the Bash console is the one that your web app is using?

Yep. I'm pretty sure. I have "/home/cfranz01/.virtualenvs/django3" in the "Virtualenv:" section of the Web setup screen and when I press the "Start a console in this virtualenv" I get the following (I also decided the get the python version to be sure):

(django3) 16:17 ~/django_projects/mysite $ python -V
Python 3.9.5

Whatever I did wrong (assuming I did it and not the system) I did wrong twice. Sigh.

Thanks for the thought. Next idea?

Well. I fiddled with the 'Python version:' in the 'Code:' section of the Web screen and... while I'm still getting the message:

There is a problem with your virtualenv setup. Look at the virtualenv section below for details.

however, there is no longer the original error message or any error message showing up in the virtualenv section. No error message at all.

Good news, it doesn't seem to think there is a Python version problem,... Bad news, I get no error message at all in the virtualenv section. I got nothing.

There is an error in the virtualenv section. It's in a block coloured pink.

No.

If you look at the Virtualenv section of your Web app page, you'll see a warning in a pink box saying: This virtualenv seems to have the wrong Python version (3.8 instead of 3.9).

And now its back. The pink error has returned. This still does not help (see original missive). All it means is I'm back where I started.

And again if I go to the Bash console and run Python -V I get:

(django3) 20:53 ~/django_projects/mysite $ python -V
Python 3.9.5
(django3) 21:05 ~/django_projects/mysite $

We are, I'm afraid, going around in circles here. Could someone please look into this? The fact that I'm getting the error isn't the real issue. I still don't know WHY I'm getting the error. Everything I know to do is set to Python version 3.9.5...

You've probably created that virtualenv with 2 different Python versions in it somehow. Some users seem to do this and we have not been able to work out how, since virtualenv has protections against it. Delete the virtualenv and recreate it for the version of Python that your web app is configured for and then try to make sure that you do not add the additional version (however that may be happening). You can check after each step of your setup by looking at the files in the virtualenv bin directory. If there are 2 versions of Python in there, then the virtualenv will not work for your web app.

Fair enough. You don't know... I don't know... It's not like in my 40 years of IT experience I haven't dealt with this before. Thank you for what help you've been able to give. If I can show you any other debugging information, please let me know.

Thank you for your patients. I shell endeavor to persevere!

I shall return to why openpyxl is misbehaving until my patience and equanimity has returned.

Let us know if you need any extra help.

Yet again I likewise encountered a similar blunder message(while going through the Django For Everyone course) so I deactivated my virtualenvironment utilizing ' deactivate' command and make certain to reload the progressions you make there after reactivate it utilizing ' workon' command remembering that you need to reload the progressions this ought to work