0

I got this simple problem and I can't find the answer anywhere, I'm wasting a lot of time!

I did a Python programm on Linux (which works OK), but when I try to run it on Windows, there are too problems with libs...

I have installed the libs I need (dateutil, lxml, xmlrpclib...) in C:\Python34\Lib\site-packages. But then, they don't work as they do on Linux. For example:

from dateutil.tz import tzlocal

Gives me next error:

File "C:\Python34\lib\site-packages\dateutil\tz.py", line 9, in module from six import string_types, PY3 ImportError: No module named 'six'

That is, they are not finding the other modules... why???

forvas
  • 8,705
  • 7
  • 46
  • 127

2 Answers2

1

Have you try this ?

http://www.instructables.com/id/How-to-install-Python-packages-on-Windows-7/

Maybe it can help

Johnvox
  • 52
  • 5
  • Thank you very much, I hadn't done the installation before, but now the problem is that in the middle of it, this breaks with the same errors I got if I run my programm. – forvas Mar 20 '14 at 16:21
  • Where exactly does it break ? – Johnvox Mar 20 '14 at 16:22
  • For example, with the library xmlrpclib breaks with this error (in line 193): File "C:\Python34\lib\site-packages\xmlrpclib.py", line 193 MAXINT = 2L**31-1 ^ SyntaxError: invalid syntax – forvas Mar 20 '14 at 16:36
  • 1
    xmlrpclib isn't a Pyhton 3.4 lib it has been replace by xmlrpc.client I think this is why you get some syntax error – Johnvox Mar 20 '14 at 16:40
  • You were right, I stopped using xmlrpclib and now I am using xmlrpc.client on Kubuntu and it works as well as before. But on Windows is still returning errors. But I am closer. Thank you very much! – forvas Mar 21 '14 at 11:08
  • GREAT!!! Last error on Windows was a stupid mistake by me, but now I fixed it, and xmlrpc.client works perfectly!! – forvas Mar 21 '14 at 11:17
1

It looks like you're using Python 3.4 which comes with pip. pip is a tool for installing packages and any dependencies they might have (like the srting_types module from your error message). I'd suggest learning how to use it because it resolves most of the packaging problems with you needing to moving things around yourself. See an answer from a different question to learn more about pip.

There are some packages that need to be compiled. This can be difficult on Windows 7 if you don't have the proper toolchain set up to compile packages. I'd recommend Christoph Gohlke's wonderful collection of installable packages for Windows. You just need to make sure to grab the right version. Since 3.4 is still relatively new, some packages may not be available, so be warned.

Community
  • 1
  • 1
qmoog
  • 205
  • 1
  • 13
  • You are right, I used pip and I solved the problem with dateutil and six libraries. However, with lxml and xmlrpclib I get errors. For example, with xmlrpclib I get this: Some externally hosted files were ignored (use --allow-external xmlrpclib to allow). – forvas Mar 21 '14 at 09:02
  • I managed to install lxml without pip and now it works. But I can't find xmlrpclib for Windows anywhere. – forvas Mar 21 '14 at 10:04