2

I have created a virtual environment in vscode and also activated it, however, the virtual environment is not being shown in python interpreter path. only the default python path is being shown. Also when I am trying to install any module in terminal while the venv active, it just shows that Unable to create process using "" install module. Please help me with this problem.

Here are the steps which I used to create the virtual environment:

  1. I installed the virtualenv module by using the command 'pip install virtualenv'
  2. I created the virtual environment in a folder by using the command 'virtualenv myprojectenv'
  3. Then I activated the virtual env by using the command '.\myprojectenv\Scripts\activate.ps1'
  4. It took me inside the virtual environment. Then I tried to install the module 'flask' by using the command 'pip install flask', but then it showed the error - 'Unable to create process using "" ' enter image description here

Also please provide me a solution in layman's language as I am a beginner in the coding field

5
  • 1
    could you pls post the steps you used to create the Virtual Environment, also could you please post a screenshot of the error you get in the terminal. Commented Jan 4, 2021 at 7:06
  • I have added the steps in the question. Commented Jan 5, 2021 at 4:16
  • Instead of screenshots, it is recommended to use copy-paste (of relevant parts) from the terminal (formatted as code) in the question. This makes the question more easy to be searched for. Commented Jan 24, 2021 at 13:23
  • 1
    It seems that you've done everything correctly. Running activate.ps1 should inject the Scripts folder (with pip.exe and python.exe) to the PATH of the process. Did you resolve this already? One option would be to use plain venv instead of virtualenv. Also, as a workaround you can use myprojectenv\Scripts\python.exe -m pip install flask to force the usage of the pip of your virtual environment. Commented Jan 24, 2021 at 13:26
  • Python3 comes with venv module, you don't need to install virtualenv Commented Jan 24, 2021 at 15:22

1 Answer 1

0

to install flask write the code in the terminal:- py -m pip install flask

On running this code in Virtual Studio Code, these 5 packages will be installed automatically along with flask.

  1. Werkzeug
  2. itsdangerous
  3. click
  4. Jinja
  5. MarkupSafe
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.