Tag Info

Hot answers tagged

13

Yes, a virtualenv is quite suitable for production -- we have (very) large Python-using customers running their apps inside of a virtualenv, and it works very well to keep them isolated from the system Python configuration. However, I wouldn't recommend using it for "portability" -- trying to transport the whole thing from machine to machine. There's far ...


4

I tracked this one down with the help of davisp, a gunicorn developer. Thank you ! It was an environnement issue, caused by an invalid HOME setting in the environnement of the supervisor gunicorn subprocess. I did not get anything on stderr until I put an "import psycopg2" in my settings.py file, which produced the following message on supervisor's stderr ...


4

Just add path to your virtual env to <pythonpath> in uwsgi's app_conf.xml file. eg: <pythonpath>/srv/www</pythonpath> <pythonpath>/home/user/env/lib/python2.6/site-packages</pythonpath> <module>wsgi_configuration_module</module>


4

When installed via pip in virtualenv, the django admin script is normally installed under the name django-admin.py (with file extension). It is likely the system-wide django has this script installed without an extension, so you are falling back to it. Try $ django-admin.py --version


3

Use the checks documented in the mod_wsgi documentation to validate that how your mod_wsgi was compiled is correct: http://code.google.com/p/modwsgi/wiki/CheckingYourInstallation#Python_Shared_Library Ensure that when doing this check that LD_LIBRARY_PATH is not set. Provide the output from ldd. Also indicate whether you also have any Python 2.7 ...


3

Since you mentioned you were using Gentoo, you may want to use portage to find out what package owns that file. You can use equery (emerge gentoolkit) to figure out what package owns it: equery belongs /usr/lib64/libcurl.a


3

Depending on your version of virtualenv you might need to add the --no-site-packages flag when creating the venv like this: virtualenv --python=python2.6 --no-site-packages env That'll tell virtualenv not to make the globally installed packages available inside your venv.


3

the -H/--home/--virtualenv option does not expand the ~ symbol. Specify it as an absolute path and it should work. The same apply to configfiles, so you would add path_to_virtualenv


2

On our setup we use a PIP requirements file to specify which packages are required in a virtualenv- when doing this you can also specify which versions of the packages are allowed. Installing everything is a matter of: pip -r requirements.txt Then, to upgrade any of the packages we can change the version numbers in the requirements file and run: pip ...


2

The README file located within the source of mysql-python states the Prerequisites: Python 2.3.4 or higher setuptools MySQL 3.23.32 or higher (with many stipulations I won't post) mysql-devel mysql zlib zlib-devel openssl gcc So, try the following: yum -y install mysql-devel mysql zlib zlib-devel openssl Then try to install again: pip install ...


2

The command you provide should use the python binary inside the virtual environment: command = /home/user/Sites/my-site/venv/bin/python /home/user/Sites/my-site/app.py


2

As explained here, if you need to use pip to install a package in a virtualenv environment, just use the pip installed in virtualenv : Because pip is installed by virtualenv, just use path/to/my/environment/bin/pip to install things into that specific environment. The pip team remove the -E option because pip is now bundled into every new ...


2

I know this is an old question, but I think I have an alternative answer to this. I was experiencing the same problem. The log would show gunicorn trying to start and then lots of entries showing the port is already in use. I realised, that I had entered the virtualenv BEFORE running my script. Which then activated the virtualenv again. This seems to run ...


2

I am not sure what's going on there but if you have an unstable ssh connection, use tmux. tmux It will open a terminal session that is inside of a container that you can reconnect to later. Anything running inside that virtual terminal will keep running if the session disconnects. So after you are kicked out, ssh back in and run tmux attach then you ...


2

This is more a matter of preference and convention than anything else. On Debian systems, I tend to keep everything web-app-related under /var/www/<site_name>. If users expect to be able to access that directory, I drop a symbolic link to it under their /home/<user_name> directory. This keeps things neatly separated but accessible and would allow ...


2

You probably have an old version of boto pre-installed on your AMI that doesn't have SWF Layer 2 support yet. Check by typing this into a shell: python -c "import boto; print boto.Version" I think SWF Layer 2 was added in release 2.7, anything before that won't work. Here's the commit adding Layer2 to SWF Your easiest option is to add -U to your pip ...


2

NOTE: from your gcc -v output Try: sudo apt-get install sudo apt-get install gcc


1

The problem appears to be that you have used VENV without defining it. /root/StackScript: line 23: /bin/activate: No such file or directory the $VENV is expanding to nothing so $VENV/bin/activate becomes /bin/activate and isn't found. Perhaps you meant VENV="/srv/www/test/venv" at line 6.


1

Yes - here is explanation https://developers.google.com/appengine/docs/python/tools/libraries27#django Yes, on the development server. On Google Clound you don't need virtualenv. Google App Engine is PaaS, so you have an access only to API not to operating system. You can forget about operating system, Google takes care about it. If you like Django, so ...


1

Well without administrative privileges you're very limited on what you are able to do. If you are not allowed to elevate yourself or ask for privileges, the best way I found to go about that would be to create another environment, make a requirements.txt file, download all the packages you need to your machine( django ) that would also be located in your ...


1

Yes, 1 nginx instance and multiple (1 for each environment) uwsgi instances running. If you want separate virtualenv's for each project, of course.


1

easy_install had installed virtualenv without read permissions for group or world (only execute). Any idea why that happens? Doing chmod -R 755 on the /usr/lib/python/site-packages/virtualenv directory resolved the issue.


1

Create a backup Someone suggested on stackoverflow: I usually create a symlink from my Python site-packages directory to the Django version I am using. When I change versions I merely change the symlink to point at the right version. Here is the documentation for creating a symlink. The docs mention the development version but you can do it for any ...


1

To get virtualenv available in shell automatically you should source its bin/activate script every time the user logs in. You can do this along with creating default virtualenv environment when the user is created. Or you can just add path to the virtualenv's python interpreter to the $PATH variable right in the user's .bash_login, .zshrc or whatever else. ...


1

If you installed the modules using apt-get, you can remove them using apt-get. If you installed the modules using easy_install, they will be cataloged here: /usr/local/lib/python2.6/dist-packages/easy-install.pth Here are good instructions for removing easy_install packages. stackoverflow - removing easy_install packages When attempting to create pristine ...


1

Error importing middleware pootle_misc.middleware.baseurl: "No module named pootle_misc.middleware.baseurl" This means that it cannot load the python code that's needed for the application. Since django's running from site-packages, the pootle_misc module should probably be in there (or within a relative path would be fine, too). Look for a pootle_misc ...


1

if you are using IP to access the server, you should have ServerName or ServerAlias with the IP you are using or the virtualhost won't load.


1

Ended up following the excellent guide @ http://www.saltycrane.com/blog/2009/05/notes-using-pip-and-virtualenv-django/ I really like comprehensive tutorials like this, instead of some RTFM link to these types of things which do NOT cover integration of different services.


1

Ensure you consult: http://code.google.com/p/modwsgi/wiki/VirtualEnvironments for how to setup mod_wsgi with virtual environments. That way you can leave any existing Django alone and install new one into virtualenv and have your WSGI application under mod_wsgi use it.


1

Ubuntu's default installation of Python is different from the standard Python download, both for size and licensing reasons. To get the profile module back, you need to enable the multiverse repositories (where unsupported and questionable software goes), and install the python-profiler package. This has been filed as a bug, for reference.



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