tisn05 / sk1

Automatically exported from code.google.com/p/sk1
Other
0 stars 0 forks source link

Fail to use after installation #18

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I tried to install latest releases of sk1libs and uniconvertor using "python 
setup.py install", but I can't use import uniconvertor correctly:

Here is the scenario to reproduce the problem:

~$ cd /tmp
tmp$ virtualenv --no-site-packages --distribute --unzip-setuptools foo
...
tmp$ cd foo
foo$ source bin/activate
(foo)foo$ wget http://sk1project.org/dc.php?target=sk1libs-0.9.1.tar.gz -O 
sk1libs-0.9.1.tar.gz
...
(foo)foo$ tar xf sk1libs-0.9.1.tar.gz
(foo)foo$ cd sk1libs-0.9.1/
(foo)sk1libs-0.9.1$ python setup.py install
...
(foo)sk1libs-0.9.1$ cd ..
(foo)foo$ wget http://sk1project.org/dc.php?target=uniconvertor-1.1.5.tar.gz -O 
uniconvertor-1.1.5.tar.gz
(foo)foo$ tar xf uniconvertor-1.1.5.tar.gz
(foo)foo$ cd uniconvertor-1.1.5/
(foo)uniconvertor-1.1.5$ python setup.py install
...
(foo)uniconvertor-1.1.5$ cd ..
(foo)foo$ ./bin/python
Python 2.5.5 (r255:77872, Nov 28 2010, 16:43:48)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sk1libs
>>> import uniconvertor
>>> import uniconvertor.app.io
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/tmp/foo/lib/python2.5/site-packages/uniconvertor/app/__init__.py", line 69, in <module>
    from conf.configurator import Configurator
  File "/tmp/foo/lib/python2.5/site-packages/uniconvertor/app/conf/configurator.py", line 11, in <module>
    from app.events import connector
ImportError: No module named app.events
>>> import app
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named app

The 'uniconvertor' command line tool works, but it manipulates sys.path itself.

I expect the library to install correctly using distutils/setuptools, so that 
after running setup.py's install, I can just import the module and here it goes.

Original issue reported on code.google.com by j...@multani.info on 8 Dec 2010 at 2:24

GoogleCodeExporter commented 8 years ago
python
Python 2.6.6 (r266:84292, Sep 15 2010, 16:00:36) 
[GCC 4.4.5 20100909 (prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import uniconvertor
>>> 
>>> uniconvertor.init_uniconv()
>>> 
>>> import uniconvertor.app.io
>>> 

Original comment by maxim.s.barabash@gmail.com on 8 Dec 2010 at 6:49

GoogleCodeExporter commented 8 years ago
This is not a bug. Before import uniconvertor.app.io you need running 
uniconvertor.init_uniconv() 
This routine initializes uniconvertor. Unfortunately this issue has been 
inherited from Skencil code base. We are going to reimplement it in 
uniconvertor 2.0

Original comment by Igor.E.N...@gmail.com on 8 Dec 2010 at 7:36

GoogleCodeExporter commented 8 years ago
OK, I got it.

Maybe I missed something, but I didn't find any documentation on this. May I 
suggest to add a little bit of documentation, at least for users who just want 
to import the library?
I spent a bunch of time this afternoon trying to figuring out if I was doing 
something wrong, and it would have been a real time (and hairs) saver to have 
those three lines somewhere, in the README file for example.
Once the module is loaded, it's "relatively" easy to dig in the API using 
IPython or something equivalent, but as long as you can't import this, it's a 
dead end.

Igor > Thanks for the additional information, good luck for uniconvertor 2.0!

Original comment by j...@multani.info on 8 Dec 2010 at 9:12