[BUG]: VSCode extension cannot set up Python environment on Windows
When setting up GPT-Pilot VSCode extension in windows, one of the steps is to create the Python virtual environment (venv).
This can fail (for as of yet unknown reason), and this is what the users see:
Temporary workaround:
- open command line in the
gpt-pilotsub-directory of the folder which you selected for the installation of GPT Pilot (there should berequirements.txtfile already there) - create the virtual environment with
python -m venv pilot-env - activate the environment with
pilot-env\Scripts\activate - install packages with
pip install -r requirements.txt - go to the
pilotsubdirectory (notpilot-env, justpilot). If there isgpt-pilotfile in that subdirectory delete it (that is sqlite database) and then runpython db_init.pyto initialize new database
After doing the above steps, the VSCode extension should start working.
This is likely caused by the way we chain commands to go to the directory, create the env and set it up in the VSCode extension installer script.
I am having the same error except when I try to do your workaround I get a long list of errors that flash on the screen and then disapear
To me it looks like
python db_init.py
Was unsuccessful. When I run the command should it have any output? (I have no output but also no errors)
Hi, Issue still persists even after workaround. I did a video on it https://youtu.be/ZtOBOHf5lTs?si=VXP2hbYKGcuzJhlN
When setting up GPT-Pilot VSCode extension in windows, one of the steps is to create the Python virtual environment (venv).
This can fail (for as of yet unknown reason), and this is what the users see:
Temporary workaround:
1. open command line in the `gpt-pilot` sub-directory of the folder which you selected for the installation of GPT Pilot (there should be `requirements.txt` file already there) 2. create the virtual environment with `python -m venv pilot-env` 3. activate the environment with `pilot-env\Scripts\activate` 4. install packages with `pip install -r requirements.txt` 5. go to the `pilot` subdirectory (not `pilot-env`, just `pilot`), then run `python db_init.py` to initialize the databaseAfter doing the above steps, the VSCode extension should start working.
This worked for me
We've just published an update to the VSCode extension (version 0.0.21) that fixes this.
After you install the update, you'll need to go to Settings (in the extension) and choose a different (new) directory for gpt-pilot installation. This is because the old folder has incomplete install, which gives that error. Alternatively you can just remove that gpt-pilot folder in the windows explorer and start the extension which will try to re-initialize it.
@Eforen @fahdmirza @jdavid82 please try it out and let us know if that fixes it for you.
I am still getting this error this morning.
I am still getting this error this morning.
same
Just adding this to see if it helps locate the cause of this issue. After the install, I get this error: Traceback (most recent call last): File "c:\AI\gpt-pilot\workspace/gpt-pilot/pilot/main.py", line 8, in from dotenv import load_dotenv ModuleNotFoundError: No module named 'dotenv'
See image
I did try deleting the workspace directory and letting it re-initialize it. This caused an error because the last slash in the path was incorrect, (see image) which made it just loop. I manually created the directories and it did re-initialize the workspace, but didn't fix the above error.
Brian
Just adding this to see if it helps locate the cause of this issue. After the install, I get this error: Traceback (most recent call last): File "c:\AI\gpt-pilot\workspace/gpt-pilot/pilot/main.py", line 8, in from dotenv import load_dotenv ModuleNotFoundError: No module named 'dotenv'
See image
I did try deleting the workspace directory and letting it re-initialize it. This caused an error because the last slash in the path was incorrect, (see image) which made it just loop. I manually created the directories and it did re-initialize the workspace, but didn't fix the above error.
Brian
![]()
Having this same issue on Windows.
Didn't have to manaully go in and fix the install to get to the same point but still the same result.
Having the same issue on M2 Mac
Guys any update ? I also have the same dotenv error as others stated.
Hi guys,
we're still working on the issue. In the meantime please try the workaround steps from the description, while making sure you're in the right directory.
I just don't understand why Youtubers are reviewing this app when it just doesn't work. ffs!
The workaround still lands at the dotenv not found error. Any other workaround other than what is posted above ?
Solved with this steps:
- Delete the 'gpt-pilot' folder.
- Install another version of the plugin and select 0.0.20.
- Use the plugin until the error occurs.
- Delete the 'gpt-pilot' folder.
- Update to new version
I just don't understand why Youtubers are reviewing this app when it just doesn't work. ffs!
because the youtubers use mac computers
@Siddharth1988 @FreddyCi @RFARREY I was getting the missing dotenv issue at first.
I got this working on a fresh version of the extension I downloaded yesterday. You might want to try uninstalling + deleting your current extension (and the entire GPT-Pilot folder) and redownloading / starting over if you have been having issues up to this point.
Make sure you have a recent version of Python installed, I am using python 3.10.6 on Windows 11
Make sure you can run the python command from inside your terminal in vscode and the expected version initializes (pretty sure it needs to be greater than version 3.9. I use 3.10.6 because stable diffusion required it)
To start, when I opened my terminal in VSCode. It brought me to C:\Users\aaron\PycharmProjects\GPT_Pilot\gpt-pilot\workspace This is correct, but notice the \workspace.
If you are there, cd .. up a level into \gpt-pilot
In the gpt-pilot dir, confirm there is a requirements.txt file in that directory using dir or ls. Also confirm there is a directory there called \pilot-env
If that directory already exists, run ./pilot-env/Scripts/activate
if not, run
python -m venv pilot-env
./pilot-env/Scripts/activate
Once the virtual environment is activated, install required packages with pip install -r requirements.txt
go to the pilot subdirectory (not pilot-env, just pilot), cd pilot, then run python db_init.py to initialize the database.
Once you have done all of this, reopen the gpt-pilot extension using the icon on the left panel in vscode. signin, and select new project. It should initialize correctly now.
Getting this error with @aaronjolson's steps.
@Siddharth1988 @FreddyCi @RFARREY
I got this working on a fresh version of the extension I downloaded yesterday. You might want to try uninstalling + deleting your current extension (and the entire GPT-Pilot folder) and redownloading / starting over if you have been having issues up to this point.
Make sure you have a recent version of Python installed, I am using python 3.10.6 on Windows 11 Make sure you can run the
pythoncommand from inside your terminal in vscode and the expected version initializes (pretty sure it needs to be greater than version 3.9. I use 3.10.6 because stable diffusion required it)To start, when I opened my terminal in VSCode. It brought me to
C:\Users\aaron\PycharmProjects\GPT_Pilot\gpt-pilot\workspaceThis is correct, but notice the\workspace. If you are there,cd ..up a level into \gpt-pilotIn the gpt-pilot dir, confirm there is a requirements.txt file in that directory using
dirorls. Also confirm there is a directory there called \pilot-env If that directory already exists, run./pilot-env/Scripts/activateif not, runpython -m venv pilot-env ./pilot-env/Scripts/activateOnce the virtual environment is activated, install required packages with
pip install -r requirements.txtgo to the pilot subdirectory (not pilot-env, just pilot),cd pilot, then runpython db_init.pto initialize the database.Once you have done all of this, reopen the gpt-pilot extension using the icon on the left panel in vscode. signin, and select new project. It should initialize correctly now.
There's a slight typo here, missing the last character of the last file extension to run. Should be "db_init.py" (that got me working)
@Siddharth1988 @FreddyCi @RFARREY I got this working on a fresh version of the extension I downloaded yesterday. You might want to try uninstalling + deleting your current extension (and the entire GPT-Pilot folder) and redownloading / starting over if you have been having issues up to this point. Make sure you have a recent version of Python installed, I am using python 3.10.6 on Windows 11 Make sure you can run the
pythoncommand from inside your terminal in vscode and the expected version initializes (pretty sure it needs to be greater than version 3.9. I use 3.10.6 because stable diffusion required it) To start, when I opened my terminal in VSCode. It brought me toC:\Users\aaron\PycharmProjects\GPT_Pilot\gpt-pilot\workspaceThis is correct, but notice the\workspace. If you are there,cd ..up a level into \gpt-pilot In the gpt-pilot dir, confirm there is a requirements.txt file in that directory usingdirorls. Also confirm there is a directory there called \pilot-env If that directory already exists, run./pilot-env/Scripts/activateif not, runpython -m venv pilot-env ./pilot-env/Scripts/activateOnce the virtual environment is activated, install required packages with
pip install -r requirements.txtgo to the pilot subdirectory (not pilot-env, just pilot),cd pilot, then runpython db_init.pto initialize the database. Once you have done all of this, reopen the gpt-pilot extension using the icon on the left panel in vscode. signin, and select new project. It should initialize correctly now.There's a slight typo here, missing the last character of the last file extension to run. Should be "db_init.py" (that got me working)
I followed these instructions and caught the typo, but still end up with my errors above.
@MikeTheBard - what version of windows + python are you using?
Did all the dependencies install correctly when you ran pip install -r requirements.txt ?
Just adding this to see if it helps locate the cause of this issue. After the install, I get this error: Traceback (most recent call last): File "c:\AI\gpt-pilot\workspace/gpt-pilot/pilot/main.py", line 8, in from dotenv import load_dotenv ModuleNotFoundError: No module named 'dotenv'
See image
I did try deleting the workspace directory and letting it re-initialize it. This caused an error because the last slash in the path was incorrect, (see image) which made it just loop. I manually created the directories and it did re-initialize the workspace, but didn't fix the above error.
Brian
![]()
@brain1961 - I can tell from you above you are definitely in the wrong path (wrong directory). You have went and created new directories inside of workspace. You shouldn't be inside of workspace at all. See my instructions https://github.com/Pythagora-io/gpt-pilot/issues/387#issuecomment-1868328940
@MikeTheBard - what version of windows + python are you using? Did all the dependencies install correctly when you ran
pip install -r requirements.txt?
Windows 10 Pro 64-bit (10.0, Build 19045)
Yes, all installed correctly.
@aaronjolson - You are correct. I had installed an earlier cli version of this and I didn't think about it when I installed the extension. I removed that folder and did a clean install and it now works great. My apologies for this and thanks for all your work.
Following above workarounds and still doesn't work. This project has still a long way to go to be even in Alpha. Thanks.
When setting up GPT-Pilot VSCode extension in windows, one of the steps is to create the Python virtual environment (venv). This can fail (for as of yet unknown reason), and this is what the users see:
Temporary workaround:
1. open command line in the `gpt-pilot` sub-directory of the folder which you selected for the installation of GPT Pilot (there should be `requirements.txt` file already there) 2. create the virtual environment with `python -m venv pilot-env` 3. activate the environment with `pilot-env\Scripts\activate` 4. install packages with `pip install -r requirements.txt` 5. go to the `pilot` subdirectory (not `pilot-env`, just `pilot`), then run `python db_init.py` to initialize the databaseAfter doing the above steps, the VSCode extension should start working.
This worked for me
This same workaround by jdavid82 above works for me as well on Windows 10 machine!
@Siddharth1988 @FreddyCi @RFARREY I got this working on a fresh version of the extension I downloaded yesterday. You might want to try uninstalling + deleting your current extension (and the entire GPT-Pilot folder) and redownloading / starting over if you have been having issues up to this point. Make sure you have a recent version of Python installed, I am using python 3.10.6 on Windows 11 Make sure you can run the
pythoncommand from inside your terminal in vscode and the expected version initializes (pretty sure it needs to be greater than version 3.9. I use 3.10.6 because stable diffusion required it) To start, when I opened my terminal in VSCode. It brought me toC:\Users\aaron\PycharmProjects\GPT_Pilot\gpt-pilot\workspaceThis is correct, but notice the\workspace. If you are there,cd ..up a level into \gpt-pilot In the gpt-pilot dir, confirm there is a requirements.txt file in that directory usingdirorls. Also confirm there is a directory there called \pilot-env If that directory already exists, run./pilot-env/Scripts/activateif not, runpython -m venv pilot-env ./pilot-env/Scripts/activateOnce the virtual environment is activated, install required packages with
pip install -r requirements.txtgo to the pilot subdirectory (not pilot-env, just pilot),cd pilot, then runpython db_init.pto initialize the database. Once you have done all of this, reopen the gpt-pilot extension using the icon on the left panel in vscode. signin, and select new project. It should initialize correctly now.There's a slight typo here, missing the last character of the last file extension to run. Should be "db_init.py" (that got me working)
This worked for me with Python 3.12.1
Same problem, Windows 11 I followed all the suggestions above, nothing solved
Hopefully we get some kind soul to help
Thanks
Same problem, Window
Same problem, Windows 11 I followed all the suggestions above, nothing solved
Hopefully we get some kind soul to help
Thanks
Are you on windows 11 with VScode?

I am still getting this error this morning.


