The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum
 Origin Forum
 Using

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
spconway1987 Posted - 06/29/2015 : 09:51:37 AM
Origin Ver. and Service Release (Select Help-->About Origin): 2015 Sr2
Operating System: Windows 8

Hello,

I'm trying to use urllib2 Python module and I'm getting a no module named urllib2 error. The module works from the command prompt so I know it's in my path but I'm curious if Origin is looking in its own package store or something? Any help as to why Origin isn't recognizing the module is greatly appreciated. This is my first post so apologies if this post isn't done correctly!
3   L A T E S T    R E P L I E S    (Newest First)
AmandaLu Posted - 06/30/2015 : 04:32:52 AM
Hi spconway1987,

I cannot reproduce the problem in win8. In fact you should try imp.load_source() rather than imp.load_compiled(). And when you tried imp.load_compiled(), what's the error message you got?

BTW, what's the Python version you installed? Origin uses Python 2.7.8.

Thanks,
Amanda
spconway1987 Posted - 06/29/2015 : 11:17:26 AM
When I keep script execution at Python 3 and use

from urllib.request import urlopen

it works so I think it's an issue with Origin and using Python 2.x. I have tried switching script execution to python 2.7 which produced the same module error. I am also getting a command error when I try your suggestion of using imp.load_compiled. Changing the system variable did not seem to work as well. I'm able to use Python 3 for what I am using Origin for so I will continue to use that. Thank you so much for your quick response!!
Castiel Posted - 06/29/2015 : 10:19:59 AM
quote:
Originally posted by spconway1987

Origin Ver. and Service Release (Select Help-->About Origin): 2015 Sr2
Operating System: Windows 8

Hello,

I'm trying to use urllib2 Python module and I'm getting a no module named urllib2 error. The module works from the command prompt so I know it's in my path but I'm curious if Origin is looking in its own package store or something? Any help as to why Origin isn't recognizing the module is greatly appreciated. This is my first post so apologies if this post isn't done correctly!



Are you sure that you've switched to Python 2.7 in Origin? See the title of the script window, or check the system variable @pyv: @pyv = 3 suggests Python 3.x, and @pyv = 2 2.x.

As far as I can tell, on Windows 7, it looks in both the shipped packages and the ones in OS environment. Not sure about Windows 8. Check the sys.path after import sys.

If you are sure about the one used in Origin is Python 2.7, but fail again to import urllib2, have a try of this (given you have installed python 2.7 in C:\Python27:
import imp
imp.load_compiled('urllib2',r'C:\Python27\Lib\urllib2.pyc')



©c¡Ï   ¤È¥¹  ©f¨u©c  ©c¥ì    ¥Î¤³  ©c/     ©¦£¯
 ©c¨Ê¥Î ¤´¥¨  ¥ó ¨×   ¥ó¤á' ¥Ì©¦¥­   /¤í  ¥Õ©¦©f
   ¨Ö             ¦á          ©¦£þ  ©` ¥Õ   ©¦
                              ©¦

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000