Skip to content Skip to sidebar Skip to footer

ImportError In The Console, But Import Is Working In PyCharm

I have a programm which imports the request module like this: import urllib from urllib import request ... The programm is running fine in the PyCharm-IDE. But when I run the same

Solution 1:

urllib.request module is introduced in Python 3.x.

I suspect PyCharm is using Python 3.x, while in console you are using Python 2.x. Try using Python 3.x in console.


Post a Comment for "ImportError In The Console, But Import Is Working In PyCharm"