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 ...
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
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/...
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 ...
7
votes
What is the alternative for source command in cmd?
At CMD prompt,it worked by running
myvenv\scripts\activate.bat
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.
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 ...
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'
4
votes
What is the alternative for source command in cmd?
For activating an environment:
activate myenv
for deactivating (all)
deactivate
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 ...
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/...
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 ...
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\...
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 ...
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%.
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 ...
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 ...
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.
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 ...
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.
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 ...
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
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 ...
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/...
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
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 ...
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 ...
1
vote
Find the explicit path of %USERPROFILE% in windows 7
Managed to do it using python:
import os
os.environ['USERPROFILE']
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:...
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/...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
virtualenv × 57python × 32
linux × 9
ubuntu × 8
bash × 8
python3 × 7
pip × 7
windows × 3
windows-7 × 3
windows-10 × 3
installation × 3
zsh × 3
systemd × 3
anaconda × 3
pycharm × 3
macos × 2
command-line × 2
mac × 2
virtualbox × 2
debian × 2
permissions × 2
centos × 2
cygwin × 2
shell-script × 2
visual-studio-code × 2