Saturday, October 23, 2021

[SOLVED] Error setting up virtualenv for existing Django project

Issue

I grabbed the source for a project I want to play with and I'm trying to setup virtualenv. The command I run is:

. virtualenv

which results in:

__requires__: command not found
The program 'import' can be found in the following packages:
 * imagemagick
 * graphicsmagick-imagemagick-compat
Try: sudo apt-get install <selected package>
from: can't read /var/mail/pkg_resources
bash: /usr/local/bin/virtualenv: line 8: syntax error near unexpected token `newline'
bash: /usr/local/bin/virtualenv: line 8: `    sys.exit('

This is with Python 2.7.1 and virtualenv works with my other projects.


Solution

Try python virtualenv or ./virtualenv instead. . virtualenv will try to import and execute a Python script as a shell script.



Answered By - Fred Foo