简体   繁体   中英

Error while importing web package in windows

I installed web.py using cmd, it got successfully installed.

C:\Users\Admin1>pip install web.py==0.40.dev0
Requirement already satisfied: web.py==0.40.dev0 in c:\users\admin1\anaconda3\li
b\site-packages\web.py-0.40.dev0-py3.6.egg

But when I try to run this command on my python editor import web it gives error

ImportError: attempted relative import with no known parent package

Any suggestion on what m I missing?? Thanks

Domnick.

ensure you take the correct pip with the right interpreter

pip --version

and

pip3 --version

and for anaconda you have a own anaconda prompt, where you can install your packages and list, which packages are installed
On anaconda prompt:

conda list

to show your installed anaconda packages.


open the anaconda prompt:

type in:

conda install -c conda-forge web.py

I take the PyCharm IDE:

Under "file" -> "settings" -> Project Interpreter -> select Anaconda Interpreter -> in my case it´s Python3.6.1 (C:\\Anaconda3\\python.exe) interpreter located in

C:\Anaconda3\python.exe

after this settings the import statement

import web

works absolutely fine for me

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM