Skip to main content
The 2024 Developer Survey results are live! See the results
97 votes
Accepted

Can't install virtual interpreter in PyCharm in Linux

I had to install it. This was fresh Kubuntu 18.04 install, obviously, without this needed package. sudo apt-get install python3-distutils After that I restarted PyCharm and creating virtual project ...
Hrvoje T's user avatar
  • 1,949
13 votes

`python3.7: bad interpreter: No such file or directory`

I created a symlink instead of copy. brew install [email protected] ln -s /usr/local/opt/[email protected]/bin/python3.7 /usr/local/opt/python/bin/python3.7
amaurer's user avatar
  • 131
13 votes

`python3.7: bad interpreter: No such file or directory`

After a few hours, one solution was to install virtualenv again with pip, then remove it with pip: $ ls -la /usr/local/bin/virtualenv -rwxr-xr-x 1 user brew 232 29 Nov 17:06 /usr/local/bin/...
emonigma's user avatar
  • 2,037
7 votes

Can't install virtual interpreter in PyCharm in Linux

If @Hrvoje T's answer did not work (it did not work for me) then try this: Run this command and you should be able to install the packaging tools in Pycharm: sudo apt install python3-pip It's ...
hyukkyulee's user avatar
7 votes

What is the alternative for source command in cmd?

At CMD prompt,it worked by running myvenv\scripts\activate.bat
blank_mind's user avatar
7 votes
Accepted

What do double curly braces mean in systemd scripts?

The curly braces mean nothing to systemd. The other question was either using them as a placeholder for a variable name or using some kind of template to generate systemd files.
Mark Stosberg's user avatar
5 votes

What do double curly braces mean in systemd scripts?

In the linked example, {{ venv_home }} is a general placeholder for the location of the virtual environment in question (venv). For example, this could be /home/pi/yourproject. The double-curly-brace ...
myhd's user avatar
  • 157
4 votes

Activate virtualenv using alias

Alias can have list of commands: alias shazm='source ~/path-to-virtual-environment/bin/activate; cd ~/path-to-master-project-folder; ls -a'
Tomasz Jakub Rup's user avatar
4 votes

What is the alternative for source command in cmd?

For activating an environment: activate myenv for deactivating (all) deactivate
MarianD's user avatar
  • 2,716
4 votes

`python3.7: bad interpreter: No such file or directory`

In my case, I had installed pipenv on MacOS with: brew install pipenv It was trying to use Python 3.6 instead of the 3.7 I actually had. So I solved the issue by uninstalling: brew uninstall ...
David Villamizar's user avatar
3 votes

`python3.7: bad interpreter: No such file or directory`

In my case, I was on MacOS and I had python3.9 installed, but virtualenv was installed using python3.7 and at some point I uninstalled python3.7. $ /usr/local/bin/virtualenv --version -bash: /usr/...
sin.ak's user avatar
  • 31
3 votes
Accepted

Error "You must 'source' the script:" while trying to ativate python virtualenv on Windows10

Like the error message specifically says, the correct way to run the script is to source it: . noc\Scripts\activate.ps1 The single dot is an alias for the source command. This causes the script to ...
tripleee's user avatar
  • 3,231
3 votes

What is the alternative for source command in cmd?

Go to the the directory where you have the ".bat" file by executing this command: C:\Users\MyName\Desktop\ProjectsWork\FlaskApplication> cd env\Scripts Then just call the ".bat" file \Desktop\...
Mourad's user avatar
  • 139
3 votes
Accepted

Python virtualenv not activating in Windows 10 Cmder

Note this answer is outdated and no longer required as cmder supports conda/venv now. Update your cmder install if it's not working for you. Original (outdated) answer I had a similar issue with a ...
user2856's user avatar
  • 744
2 votes
Accepted

Find the explicit path of %USERPROFILE% in windows 7

If you're not looking for a python-specific answer, you can just open a command prompt and run echo %userprofile%.
Ƭᴇcʜιᴇ007's user avatar
2 votes
Accepted

Hook into "command not found" handler in Ubuntu

For bash, its behavior is governed by the shell function command_not_found_handle (See man bash, under COMMAND EXECUTION). To see what behavior is defined by that function, you can issue: declare -p ...
Randall's user avatar
  • 272
2 votes

Can't install virtual interpreter in PyCharm in Linux

Neither @Hrvoje T and @hyukkyulee worked for me since I had already installed those packages. Uninstalling and reinstalling didn't solve the issue as well. I just upgraded my system to Ubuntu 19.10 ...
Koldar's user avatar
  • 121
2 votes

Permission Denied When Trying to Create Python3 Virtual Environment

try and run sudo python3 -m venv ~/path/to/venv. sudo in Linux environment means super user do which basically means that you are giving a command with super user access.
Rohit Rawat's user avatar
1 vote

How to create python virtualenv through userdata in an Amazon EC2 (Amazon Linux 2) instance?

This is the code to create virtual environment using user-data in aws ec2-instances. #!/bin/bash sudo yum update sudo yum install python3 pip3 -y sudo pip3 install --upgrade pip pip install --upgrade ...
rajeevpunna's user avatar
1 vote

macOS Catalina (10.15) not using correct Python interpreter within virtual environment

Existing venvs typically need to be re-created after the Python has been updated. Any venvs created with a python -m venv command can be upgraded with the --upgrade option.
ankostis's user avatar
  • 217
1 vote

systemd service running from pipenv

Why are you hardcoding all of the paths? To my knowledge, you only need to hardcode the pipenv path: the point of pipenv is that it'll take care of everything else. Try the following in your ...
Hari Amoor's user avatar
1 vote

`python3.7: bad interpreter: No such file or directory`

In my case what solved the situation was adding a line at the end of the ~/.zshrc file: export PATH=/usr/local/opt/python/libexec/bin:$PATH hope it helps. source
Claus's user avatar
  • 121
1 vote

`python3.7: bad interpreter: No such file or directory`

That solved the problem in my case: (my env file is called .venv) mv .venv .venv_old python3.7 -m venv .venv source .venv/bin/activate pip install wheel pip install --upgrade pip wheel setuptools pip ...
Benjamin Crouzier's user avatar
1 vote

`python3.7: bad interpreter: No such file or directory`

Try installing [email protected] via homebrew and then cping that installation into the directory the program expects to find it. brew install [email protected] cp -r /usr/local/opt/[email protected]/bin/python3.7 /usr/...
Matthew Hinea's user avatar
1 vote

What is the alternative for source command in cmd?

If you want to use your environment in batch file then call C:\ProgramData\Anaconda3\Scripts\activate.bat C:\ProgramData\Anaconda3 All the following command will be executed in virtual environment
Qin Heyang's user avatar
1 vote

Activate virtualenv using alias

This is a core feature of the virtualenvwrapper package, along with a robust, complementary featureset. To create a virtualenv named shazam using virtualenvwrapper, simply: mkvirtualenv shazam To ...
Stew's user avatar
  • 1,429
1 vote

Unable to set up virtualenv on CentOS for python3

Try this: /usr/local/lib/python3.5 -m virtualenv env What we are doing here is making sure we are running the specific python3.5 executable you have installed in a local folder and wanted to use and ...
Dirk R's user avatar
  • 111
1 vote

Find the explicit path of %USERPROFILE% in windows 7

Managed to do it using python: import os os.environ['USERPROFILE']
Lee's user avatar
  • 899
1 vote

pip install virtualenv taking forever on Windows 7

I don't know whether you're behind a corporate proxy, but defining http_proxy and https_proxy with the following values helped for me (example on windows): set http_proxy=http://proxy.company.com:...
yohann.martineau's user avatar
1 vote

bash shell error: "no such file or directory"

If none of the answers work like for myself, just create an empty file at the location giving out an error and shebang to it. In the case of OP: sudo nano /usr/share/virtualenvwrapper/...
ritiek's user avatar
  • 111

Only top scored, non community-wiki answers of a minimum length are eligible