Imports in python that are not found

0

Good afternoon!    I'm facing some problems with imports downloaded with the pip, more specifically imports Pypi Wikipedia and Google ...    I install both via pip install and they can be found in the site-packages folder in Python. But imports do not work.    Environment (Windows 10 and Windows 7):    In both I am using VSCode to program in Python, other imports like chatterbot work perfectly, however those 2 above do not work.    I realized that if I create a new document and program, make the wikipedia class import works, I can use its methods perfectly, but to execute, when saving to a folder on the desktop for example, import wikipedia simply stops being recognized.

import wikipedia

wikipedia.set_lang('pt')

print(wikipedia.search("Barack"))

I do not know when saving the file, it can no longer trace wikipedia inside the site-packages folder, but the chatterbot for example is in the same folder and I do not have this problem.

    
asked by anonymous 12.09.2018 / 20:01

1 answer

0

I was able to solve my problems, I actually needed to configure virtualenv, probably because some of these imports really needed, so I ran this command:

pip.exe install virtualenv

and now works perfectly.

    
13.09.2018 / 02:54