Common problem with Python Library

Hi,

I'm currently testing the new YouTrack 3. Unfortunately, I cannot use the Python Library in order to import existing issues by Trac (or as fallback: with CSV).

Actually, I'm not very familiar with Python: I cannot say if this is only a misconfiguration (by myself) or an actual bug.

After downloading the specified library (api-3.0), I ran into some YouTrack-Python-Lib issues. Perhaps I'd misunderstood something, but my way was:

cd extracted-dir/python

vi tests/connection_test.py                     # editing connection props

python tests/connection_test.py

Traceback (most recent call last):   File "tests/connection_test.py", line 3, in <module>     from youtrack import YouTrackException, EnumBundle, EnumField, UserBundle ImportError: No module named youtrack

python -V

Python 2.7.1+

uname -a

Linux * 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:24 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux

Other scripts (like trac2youtrack or csv2youtrack) fail with similar exceptions not founding the "local modules".

As described in several posts, I'd tried setting $PYTHONPATH to the given "extracted-dir/python"-directory, but this does not solve the problem.

14 comments
Comment actions Permalink

Looks like there might be some stuff missing.. I'm having problems too:

http://devnet.jetbrains.net/thread/305262?tstart=0

0
Comment actions Permalink

Hello!

That was our mistake. You can download correct version of library from here: http://www.jetbrains.com/youtrack/tools/index.html

Sergey.

0
Comment actions Permalink

Well, actually nothing changed. :-( Is api-3.0 up to date?

0
Comment actions Permalink

Hello, Jan.

What is the name of the file, you've downloaded? And what Pyhton version do you use?

Also, what message returns import from trac?

0
Comment actions Permalink

wget --cache=off http://download-ln.jetbrains.com/charisma/youtrack-python-api-3_0.zip

*:~$ md5sum youtrack-python-api-3_0.zip 84b2d8f1c03b9aced5f6c62f9b634186  youtrack-python-api-3_0.zip

Python is still 2.7.1+ (Ubuntu)

0
Comment actions Permalink

Try to replace track2youtrack.py with attached file



Attachment(s):
trac2youtrack.py.zip
0
Comment actions Permalink

Nope.

*:~/python$ python trac2youtrack.py Traceback (most recent call last):   File "trac2youtrack.py", line 4, in <module>     from tracLib.client import Client   File "/home/tc/python/tracLib/client.py", line 1, in <module>     from trac.env import Environment ImportError: No module named trac.env *:~/python$ python tests/connection_test.py Traceback (most recent call last):   File "tests/connection_test.py", line 3, in <module>     from youtrack import YouTrackException, EnumBundle, EnumField, UserBundle ImportError: No module named youtrack

At least: Copying the tests/connection_test.py to ./ and remvoing the "os"-imports helps for the testing. The actual test cases do not working (bundle not found, etc), but the modules were found, the enviroment was built up and the connection correctly established. Seems to be a problem with the "scope"?

0
Comment actions Permalink

What trac environmen path do you pass to script?

0
Comment actions Permalink

So, re-configured. The YouTrack runs on another machine, so I'd installed trac and made a copy of the trac enviroment via scp -r.

python trac2youtrack.py http://* <name> <password> <ID> "NAME" /home/tc/python/trac-env

Using our original trac server itself is not possible due syntax errors; I think thats because of an older Python 2.4.

I thought that the error is a missing module "trac.env". Is this actually a missing repo only?

0
Comment actions Permalink

trac.env is python module in trac which is something like public interface of trac. It has some common methods to access data, so you should have it on same machine, where you run script.

0
Comment actions Permalink

Soooo.. I'm just re-running the stuff on another machine (debian, python 2.5, unpatched original youtrack api 3.0). Same errors.

But after using aptitude install trac, I can run the script trac2youtrack finally. However, the other scripts (googlecode, csv) failed with messages like "module csvClient / googleCode not found".

0
Comment actions Permalink

Sorry, didn't understand you. Did you managed to to run trac import?

What about csv and googleCode to run them you should install some additional libraris, as googleCode rest library.

0
Comment actions Permalink

Yes.. relocating the python/tests/connection_test.py to python/connection_test.py solves the problem with the test. And trac import works after installing trac and reconfiguring the trac enviroment.

This was now a debian lenny with python 2.5. I will retry the trac import on the ubuntu machine with python 2.7 next week.

What about csv and googleCode to run them you should install some additional libraris, as googleCode rest library.

I need more additional libraries? Which ones? Obviously we need trac-python, but what else? This should be written down or - when possible - recognized and printed out.

Traceback (most recent call last):   File "csv2youtrack.py", line 1, in <module>     from csvClient.client import Client ImportError: No module named csvClient.client

0
Comment actions Permalink

You do not need any more libraries for trac import.

I'll investigate your problem with csv now.

0

Please sign in to leave a comment.