3

I am trying to install Exscript from github.

pip install -e 'git+git://github.com/knipknap/exscript.git#egg=Exscript'
...
Successfully installed Exscript
Cleaning up..

When i try to load it, python is not able to find it:

python2.7 -c "import Exscript"
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named Exscript

But, when i try to install it in the same virtualenv with setup.py it installs and loads successfully.

What am i doing wrong?

Ani Menon
  • 27,209
  • 16
  • 105
  • 126
gtfx
  • 193
  • 1
  • 2
  • 10
  • 2
    You checked the `site.packages` folder if it is installed there? – dav1d May 13 '12 at 08:46
  • Is pip leaving an `src` folder in the current directory. As far as I can see, pip is failing to install the package in `site-packages` and just leaving an egg link over there. Strange... – ubik May 13 '12 at 09:34

1 Answers1

2

The flag -e means "editable", and what happens behind the scenes is a symlink, and as I see, Exscript uses a directory named src, what is not seen a good practice[1].

So, in order to solve your problem, you have two alternatives:

  1. Remove -e flag
  2. Change Exscript to get rid of src, and use another directory name

Take a look at https://the-hitchhikers-guide-to-packaging.readthedocs.io/en/latest/creation.html#arranging-your-file-and-directory-structure and https://setuptools.readthedocs.io/en/latest/userguide/development_mode.html.

[1]: the good practice is to have the directory as the same name as used when importing the package

user202729
  • 3,358
  • 3
  • 25
  • 36
Hugo Lopes Tavares
  • 28,528
  • 5
  • 47
  • 45