Skip to content

Instantly share code, notes, and snippets.

@rich-hart
Created February 24, 2015 18:10
Show Gist options
  • Save rich-hart/3307172d6a034de3abdd to your computer and use it in GitHub Desktop.
Save rich-hart/3307172d6a034de3abdd to your computer and use it in GitHub Desktop.
virtualenv linking notes
$ psql -U postgres
psql (9.4.1)
Type "help" for help.
postgres=# do language plpythonu $$import cnxarchive; import plpy; plpy.info(cnxarchive.__file__)$$;
ERROR: language "plpythonu" does not exist
HINT: Use CREATE LANGUAGE to load the language into the database.
$ sudo python flip_home_site_packages.py ./
Password:
Traceback (most recent call last):
File "flip_home_site_packages.py", line 34, in <module>
main()
File "flip_home_site_packages.py", line 27, in main
os.unlink(site_packages)
OSError: [Errno 1] Operation not permitted: '/Users/openstax/Library/Python/2.7/lib/python/site-packages'
#!/bin/bash
mkdir development
cd development
virtualenv .
USER_SITEPACKAGES=$(python -c 'import site;print(site.getusersitepackages())')
mkdir -p ${USER_SITEPACKAGES}
ln -s ./lib/python2.7/site-packages ${USER_SITEPACKAGES}
********* Running this seems to work but it doesn't change the status of cnx-archive tests *********
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment