Author Topic: atkpython breaks python install?  (Read 15538 times)

0 Members and 1 Guest are viewing this topic.

Offline esp

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 318
  • Country: us
  • Reputation: 3
    • View Profile
    • University of Minnesota
atkpython breaks python install?
« 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 . . .

Offline esp

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 318
  • Country: us
  • Reputation: 3
    • View Profile
    • University of Minnesota
Re: atkpython breaks python install?
« Reply #1 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

Offline Nordland

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 812
  • Reputation: 18
    • View Profile
Re: atkpython breaks python install?
« Reply #2 on: July 16, 2012, 18:04 »
Can you check if there is a parameter set in your environment called PYTHONPATH or PYTHONHOME?

Offline esp

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 318
  • Country: us
  • Reputation: 3
    • View Profile
    • University of Minnesota
Re: atkpython breaks python install?
« Reply #3 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

Offline esp

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 318
  • Country: us
  • Reputation: 3
    • View Profile
    • University of Minnesota
Re: atkpython breaks python install?
« Reply #4 on: July 16, 2012, 19:49 »
I removed atkpython again, python runs fine .. if i install it i get those errors

Offline Nordland

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 812
  • Reputation: 18
    • View Profile
Re: atkpython breaks python install?
« Reply #5 on: July 16, 2012, 20:51 »
And this is the environment variable python path?

Offline esp

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 318
  • Country: us
  • Reputation: 3
    • View Profile
    • University of Minnesota
Re: atkpython breaks python install?
« Reply #6 on: July 16, 2012, 21:05 »
yes

Offline Nordland

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 812
  • Reputation: 18
    • View Profile
Re: atkpython breaks python install?
« Reply #7 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?

Offline esp

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 318
  • Country: us
  • Reputation: 3
    • View Profile
    • University of Minnesota
Re: atkpython breaks python install?
« Reply #8 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()

Offline esp

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 318
  • Country: us
  • Reputation: 3
    • View Profile
    • University of Minnesota
Re: atkpython breaks python install?
« Reply #9 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 ....
« Last Edit: July 16, 2012, 22:03 by esp »

Offline Nordland

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 812
  • Reputation: 18
    • View Profile
Re: atkpython breaks python install?
« Reply #10 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?

Offline esp

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 318
  • Country: us
  • Reputation: 3
    • View Profile
    • University of Minnesota
Re: atkpython breaks python install?
« Reply #11 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

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5574
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: atkpython breaks python install?
« Reply #12 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.

Offline esp

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 318
  • Country: us
  • Reputation: 3
    • View Profile
    • University of Minnesota
Re: atkpython breaks python install?
« Reply #13 on: July 18, 2012, 18:39 »
thank you