gpt-pilot: 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:

image

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). If there is gpt-pilot file in that subdirectory delete it (that is sqlite database) and then run python db_init.py to initialize new database

After doing the above steps, the VSCode extension should start working.

About this issue

  • Original URL
  • State: open
  • Created 6 months ago
  • Reactions: 5
  • Comments: 42 (1 by maintainers)

Most upvoted comments

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

Following above workarounds and still doesn’t work. This project has still a long way to go to be even in Alpha. Thanks.

@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.

The workaround still lands at the dotenv not found error. Any other workaround other than what is posted above ?

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

New app error workspace

Hi everyone, we are still trying to find a fix for this issue.

There is new version of extension live. After updating extension you should select new folder in “settings” to get a fresh install of GPT Pilot. If this worked for you please give it a thumbs up or leave a comment so we know.

If you are still having this issue, I would be more than happy to jump on a call and help you with debugging and setting up GPT Pilot. Please DM me on discord (leonostrez) and we can hop on a call.

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:

image

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 database

After doing the above steps, the VSCode extension should start working.

This worked for me

@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.

Thanks , it works for me under Windows 11

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.

Hi, Issue still persists even after workaround. I did a video on it https://youtu.be/ZtOBOHf5lTs?si=VXP2hbYKGcuzJhlN

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 image

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)