0

System

  • Win7 64bit
  • Python in two locations:
    • C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Python
    • C:\Python
  • IDE is Spyder downloaded with WinPython
  • Package manager is WinPython Control Panel

Problem

Trying to import the module xlwt using the methods mentioned here

  • pip is throwing an error that it can't find "main"
  • easy_install seems to work but still cant "import xlwt" in python
  • manual install is the same as easy_install above
  • install through package manager is showing no errors

All these approaches have been tried in both locations of the python installation with and with admin privileges.

Does anyone see what I am missing? Thanks

5
  • what's the output from echo %PATH% in windows command prompt? Also try running your scripts without Spyder, I've seen a few questions the last few weeks that has odd behaviours in Spyder and it appears to cause a lot of issues.
    – Torxed
    Mar 31, 2016 at 8:57
  • Which Python are you using? Having two locations will only serve to confuse, I suggest you uninstall one of them - unless you have a good reason for having two. Check your PYTHONPATH environment variable.
    – cdarke
    Mar 31, 2016 at 9:00
  • tried running in IDLE as well, no luck. Tried importing in cmd > python and it works! The PATH for python is C:\Python\python-3.4.3.amd64\Scripts; How do I get the PYTHONPATH?
    – Eoin
    Mar 31, 2016 at 9:49
  • PYTHONPATH is an environment variable, you get it in the same way as any other environment variable on Windows. You can use the GUI, or on cmd.exe type echo %PYTHONPATH%. If you want to see all your environment variables, on cmd.exe type SET. My best guess for your problem is that you are installing into one python environment but running the other. Why do you have two?
    – cdarke
    Mar 31, 2016 at 10:22
  • ok it seems that it is unset as it is only echoing "%PYTHONPATH%" would I need this even though I have set a python path in the PATH env variable?
    – Eoin
    Mar 31, 2016 at 10:24

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.