1

I have anaconda python3.6 installed and set as default python interpreter.

I've made test package like it is recommended here:
Packaging Python Projects

I've gone through this man page to section "Generating distribution archives". Instead of executing steps described in section "Uploading the distribution archives" I simply had done local installation by pip install ./development/MyPackage-0.0.4.tar.gz"
And it had worked,
import mypackage` works fine.

But I had forgotten to activate virtualenv for testing.
So, I'd tried to make pip uninstall mypackage.
And pip is telling that there is no such packege.
I've just search for such problem, and have found the same problem on Linux OS (here). I did't use flag -e for installing my custom package.

I can't find any entries of my dev folder. But, here are results of calling sys.path.

Interring python I have this:

import site
>>> for p in site.sys.path:
...     print(p)
... 

/Users/aleksandrpavlenko/.virtualenvs/django_drf/lib/python36.zip
/Users/aleksandrpavlenko/.virtualenvs/django_drf/lib/python3.6
/Users/aleksandrpavlenko/.virtualenvs/django_drf/lib/python3.6/lib-dynload
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6
/Users/aleksandrpavlenko/.virtualenvs/django_drf/lib/python3.6/site-packages   

But, running python -m site command I have this:

sys.path = [
'/Users/aleksandrpavlenko/Documents/Development/prepandas',
'/Users/aleksandrpavlenko/.virtualenvs/django_drf/lib/python36.zip',
'/Users/aleksandrpavlenko/.virtualenvs/django_drf/lib/python3.6',
'/Users/aleksandrpavlenko/.virtualenvs/django_drf/lib/python3.6/lib-dynload',
'/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6',
'/Users/aleksandrpavlenko/.virtualenvs/django_drf/lib/python3.6/site-packages',
]
USER_BASE: '/Users/aleksandrpavlenko/.local' (exists)
USER_SITE: '/Users/aleksandrpavlenko/.local/lib/python3.6/site-packages' (exists)
ENABLE_USER_SITE: False

So I can't understand why I have '/Users/aleksandrpavlenko/Documents/Development/prepandas' entry in second case, and when I can find and delete it (so maybe this would be uninstallation).

Alex-droid AD
  • 635
  • 1
  • 6
  • 14

1 Answers1

1

I '/Users/aleksandrpavlenko/Documents/Development/prepandas' is your working directory from where you are executing python -m site command. Python by default appends current working directory in sys.path that's why you are seeing this.

You do not need to delete it or uninstall anything for making your project run smoothly. Python use this path to let you import packages from your current (project) directory.

Nafees Anwar
  • 6,324
  • 2
  • 23
  • 42