Skip to content

Instantly share code, notes, and snippets.

@kaymccormick
Created August 29, 2018 20:12
Show Gist options
  • Save kaymccormick/fce2c1aac96b0046c8a8a05f7ab421da to your computer and use it in GitHub Desktop.
Save kaymccormick/fce2c1aac96b0046c8a8a05f7ab421da to your computer and use it in GitHub Desktop.
================================= test session starts =================================
platform linux -- Python 3.7.0, pytest-3.7.3, py-1.6.0, pluggy-0.7.1
rootdir: /home/user/j/jade/newsrc/pyramid_res, inifile:
collected 0 items / 1 errors
======================================= ERRORS ========================================
___________________ ERROR collecting tests/test_resourceManager.py ____________________
ImportError while importing test module '/home/user/j/jade/newsrc/pyramid_res/tests/test_resourceManager.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
tests/test_resourceManager.py:3: in <module>
from pyramid_res import ResourceManager
E ImportError: cannot import name 'ResourceManager' from 'pyramid_res' (unknown location)
!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.10 seconds ===============================
@paigethylamine
Copy link

paigethylamine commented Dec 12, 2018

Something else I wanted to suggest is maybe consider using your local site directory rather than installing packages globally because you can really fuck up your install that way. There's a lot of crap in the python packages and sometimes things get weird. So, what I do is:

➜  ~ python3.7 -m site
sys.path = [
    '/home/erratic',
    '/usr/lib/python37.zip',
    '/usr/lib/python3.7',
    '/usr/lib/python3.7/lib-dynload',
    '/usr/lib/python3.7/site-packages',
]
USER_BASE: '/home/erratic/.local' (exists)
USER_SITE: '/home/erratic/.local/lib/python3.7/site-packages' (doesn't exist)
ENABLE_USER_SITE: True
➜  ~

And install pip modules with:

 pip install --user <module>

or:

python setup.py install --user

this will install to ~/.local/{bin,include,lib,lib64,share} respectively. You don't need to set anything for python I believe it already checks to see if USER_BASE and USER_SITE exist already but if you want to you can add /home/users/j/jade/.local/bin/ to your PATH

pipenv also offers some environment features similar to virtualenv and site_local some people like them better, I prefer to use site_local since its built into python though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment