QuantumATK Forum

QuantumATK => Installation and License Questions => Topic started by: esp on July 16, 2012, 08:43

Title: atkpython breaks python install?
Post by: esp on July 16, 2012, 08:43
i have been running atkpython just fine, but now when i try to run a basic python file as i always do, i get this error: it seems  i cannot use python by itself anymore, after installing atk 12.2 ... any ideas?

Traceback (most recent call last):
  File "C:\<myfile>.py", line 5, in <module>
    import cgi
  File ".\build\atkpython\lib\cgi.py", line 40, in <module>
    import urllib
  File ".\build\atkpython\lib\urllib.py", line 26, in <module>
    import socket
  File ".\build\atkpython\lib\socket.py", line 47, in <module>
    import _socket
ImportError: DLL load failed: %1 is not a valid Win32 application.
Press any key to continue . . .
Title: Re: atkpython breaks python install?
Post by: esp on July 16, 2012, 09:48
i uninstalled python and atk, then installed again .. still same, .. i cannot use python anymore unless i remove atk
Title: Re: atkpython breaks python install?
Post by: Nordland on July 16, 2012, 18:04
Can you check if there is a parameter set in your environment called PYTHONPATH or PYTHONHOME?
Title: Re: atkpython breaks python install?
Post by: esp on July 16, 2012, 19:47
yes it was set before i uninstalled and re-installed, and it is still there:

C:\Python27;C:\Python27\Lib\PyChart-1.26.1\pychart;C:\Python27\Lib\matplotlib-1.0.1;C:\Python27\Lib\site-packages;C:\Program Files (x86)\QuantumWise\atk-12.2.1\atkpython\lib
Title: Re: atkpython breaks python install?
Post by: esp on July 16, 2012, 19:49
I removed atkpython again, python runs fine .. if i install it i get those errors
Title: Re: atkpython breaks python install?
Post by: Nordland on July 16, 2012, 20:51
And this is the environment variable python path?
Title: Re: atkpython breaks python install?
Post by: esp on July 16, 2012, 21:05
yes
Title: Re: atkpython breaks python install?
Post by: Nordland on July 16, 2012, 21:18
Okay.

Two important things:
* Removing the atkpython stuff should fix your problem.
* Is this something you have inserted? or how did it get there?
Title: Re: atkpython breaks python install?
Post by: esp on July 16, 2012, 21:59
I am not sure what you mean .. if i uninstall atkpython python works fine .. if i install atkpython i can use atkpython but not python alone, as it seems to be showing that atkpython libraries are not compliant with standard python ... if i do not include certain libraries it also works .. for example a basic python file with no imports works .. but when i include things like cgi or urlib which i use for various things, the error message coming from atkpython libraries shown above, stops normal python from working ... try importing these below, which i use routinely, and compile with python on a windows 64-bit pc where atkpython is installed .. for me, it does not work ... remove atk and it works fine ...


# enable debugging
import platform
import sys
import cgi
import cgitb
import smtplib
import os
import time
import datetime   
import re
import urllib
import subprocess
cgitb.enable()
Title: Re: atkpython breaks python install?
Post by: esp on July 16, 2012, 22:00
ok you are saying to remove the atk stuff from the path .. that makes sense actually, i will try

will that mean if i do that, that i then cannot run from normal python? i assume the atk stuff is there so i can run from calling normal python, ... if i will no longer be able to run from python, i suppose i have to start using atkpython directly ....
Title: Re: atkpython breaks python install?
Post by: Nordland on July 16, 2012, 22:23
Okay lets start over.

atkpython is our python with alot of package preinstalled. You can install new packages in it etc, so there is no reason for not using at your normal python.

Can you run ATK code from your normal python?
Title: Re: atkpython breaks python install?
Post by: esp on July 16, 2012, 22:24
ok  i can run both now .. i am not sure why i had the atk path in the python path, but i assume so that i could run atkpython from python ... but in any case i was not doing that .. i ran calling atkpython directly ... any some confusion there ... you found the problem .. thank you .. i think it is ok now
Title: Re: atkpython breaks python install?
Post by: Anders Blom on July 18, 2012, 12:12
Just to summarize, in case anyone else stumbles on the same problem:

For operation of ATK, you should not set any Python environment variables, and in particular not PYTHONHOME or PYTHONPATH. Doing so only risks messing up any existing Python installation on the computer. ATK by itself is a complete Python interpreter (this is the main reason for the large download package) and operates completely independently of any other Python version you have installed, and they don't disturb each other (if you don't set those variables!).

You should also not attempt to operate ATK from any other Python interpreter, as you perhaps tried by setting the variable; this will anyway not be possible.
Title: Re: atkpython breaks python install?
Post by: esp on July 18, 2012, 18:39
thank you