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.
Please sign in to leave a comment.
Looks like there might be some stuff missing.. I'm having problems too:
http://devnet.jetbrains.net/thread/305262?tstart=0
Hello!
That was our mistake. You can download correct version of library from here: http://www.jetbrains.com/youtrack/tools/index.html
Sergey.
Well, actually nothing changed. :-( Is api-3.0 up to date?
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?
Python is still 2.7.1+ (Ubuntu)
Try to replace track2youtrack.py with attached file
Attachment(s):
trac2youtrack.py.zip
Nope.
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"?
What trac environmen path do you pass to script?
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.
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?
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.
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".
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.
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.
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.
You do not need any more libraries for trac import.
I'll investigate your problem with csv now.