Forums

Warning: No virtualenv detected at this path. Do you need to create it?

Hi, As a new user in Pythonanywhere while setting up my environment, I receive the following error: "Warning: No virtualenv detected at this path. Do you need to create it?" My goal is to deploy apps using Dash. Using pip freeze gives me a list of installed modules in the virtual environment. The command which pip gives the path. I am using Python 3.5., on a Linux Ubuntu. What could be wrong? Thank you for your help in avance!

Can I take a look at your files? We can see them from our admin interface, but we always ask for permission first.

Sure, go ahead. Another error that it just gave when I activated using workon: No module named virtualenvwrapper

So as far as I can see you don't have any virtualenvs set up on PythonAnywhere right now. The virtualenv path you've typed into the "Web" page starts with "/home/XXXX" where the XXXX is not your username -- did you perhaps enter the location of a virtualenv on your own computer, rather than one you've created on PythonAnywhere? You need to start a regular bash console and use "mkvirtualenv something" to create it, and then install packages into it, before using it.

Hi Giles, now it works, thank you for getting me in the right direction!

No problem! Glad to help :-)

Hi Giles, Sorry to bother you again, but I have the same error message as before: "Warning: No virtualenv detected at this path. Do you need to create it? " . If I open a Bash Console at Pythonanywhere and I type in which pip it is giving me the directory I used in my configurations. The command pip freeze gives me, -as expected-, the packages that I installed. One issue might be a switch between Python 3.5 and 3.6, but I do not notice any incompatibilities in the set-up. Would you be willing to have another look at the error? Thank you very much in advance!

It looks like you've specified the virtualenv as a path all the way to the pip command inside the virtualenv -- it should just be the path to the directory instead, which in your case would be this:

/home/rrighart/.virtualenvs/pythonanywhere/

Hi Giles, could you take a look mine? I have the same issue "Warning: No virtualenv detected at this path. Do you need to create it? " /home/luw/.virtualenvs/luw-virtualenv

Have you created one?

Hi ! I tryed install using "mkvirtualenv something" but the installed used ver python 2.7 and i have a warning for this reason and in my code i still have a error message to "from flask-mysqldb import MySQ". ANy idea?

I run a bash console and run "pip install flask-mysqldb" but in the code, the error continue

I installed correctly virtual environment, and run pip install flask_mysqldb and the error continue. I can't import mysqldb

Importa librerìa

from flask_mysqldb import MySQL

Message error: ModuleNotFoundError: No module named 'flask_mysqldb'

You also posted here

Hi Friends. I found the solution When I run the program in the PythonAnywhere IDE; This keeps telling error me that it cannot load flask_mysqldb, but if you save the program and run it from the site, it does not mark an error and it works. you can see my API in: http://jaorsoftware.pythonanywhere.com/ Is working Greetings

ah great, for future reference, if you run from the PythonAnywhere IDE, you would need to specify which python to use.

I have created the virtual environment and given the correct instead getting the error no virtual env.

Could you give the exact error message you're getting, and where you are seeing it?

Hi, Im currently also having troubles with this. I have created a virtual env 3 times in attempt, and made sure to follow the guide by python everwhere. Could you please help inform me how to fix this. You have all my permission to view my account

hi, what is the exact error that you are seeing?

Hello conrad. I think I fixed the issue with directory, but now its giving me this error:

2021-04-07 15:51:45,184: Error running WSGI application
2021-04-07 15:51:45,184: ModuleNotFoundError: No module named 'flask_migrate'
2021-04-07 15:51:45,185:   File "/var/www/helliottchip_pythonanywhere_com_wsgi.py", line 16, in <module>
2021-04-07 15:51:45,185:     from main import app as application  # noqa
2021-04-07 15:51:45,185: 
2021-04-07 15:51:45,186:   File "/home/HelliottChip/mysite/main.py", line 7, in <module>
2021-04-07 15:51:45,186:     from app import app
2021-04-07 15:51:45,187: 
2021-04-07 15:51:45,187:   File "/home/HelliottChip/mysite/app/__init__.py", line 6, in <module>
2021-04-07 15:51:45,188:     from flask_migrate import Migrate

I must note this was edited. I solved the original problem. Hope this dosnt cause confusion. I did import all of these in my virtual env though, so its unclear to me

sure- make sure you are running the webapp with your virtualenv? and make sure flask_migrate is installed in the virtualenv and not just outside?

I was running it in my virtualenv, and asking around a little more. I eventually i was told to try and NOT use the virtualenv because it might not have been needed. So I no longer have it. But I still yet have the same error. I also made sure to install flask_migrate next to the pip file. But I think i may have done something wrong with the importing because i can no longer uninstall some modules and even if i do, it still wont work. Im ganna be honest, i think i screwed myself over. If you could help, that would be amazing, but at this point i might have to take it as a loss

How do you install flask_migrate? Is it installed for the same python version that your web app is running?

Hi, good morning. I have the same "Warning: No virtualenv detected at this path. Do you need to create it?" error and the path I get is the one the bash gives me when I run "which python". What am I doing wrong? Thanks!

hi Preshh- what is the exact command you are running?

Hi, good Night. I have the same "Warning: No virtualenv detected at this path. Do you need to create it?" error and the path I get is the one the bash gives me when I run "which python". What am I doing wrong? Thanks!

What is the specific path that you are providing?

Hello, I have the same problem with the environment path. I run "which python" and it shows me the path but when I put it in the venv section I get the same error: "Warning: No virtualenv detected at this path. Do you need to create it?"

Provide the directory path rather than the path to the python executable