简体   繁体   中英

Python import error: 'No module named'

Just installed python, and am running into this error:

ImportError: No module named 'semanticnet'

here are my imports:

import semanticnet as sn
import sys

I've tried the solution on this site that suggests adding:

sys.path.append('C:\Python34')

after the 'import sys', but no luck.

Does anyone know what could be causing this issue?

Here is my full code: https://ideone.com/UHRI4S , running windows 10

You need to install that library, if you're on windows which it seems because of your "C://" first install setuptools.

https://pypi.python.org/pypi/setuptools

Using Windows 8 (which includes PowerShell 3) or earlier versions of Windows with PowerShell 3 installed, it's possible to install with one simple Powershell command. Start up Powershell and paste this command:

(Invoke-WebRequest https://bootstrap.pypa.io/ez_setup.py).Content | python -

You must start the Powershell with Administrative privileges or you may choose to install a user-local installation:

(Invoke-WebRequest https://bootstrap.pypa.io/ez_setup.py).Content | python - --user

If you have Python 3.3 or later, you can use the py command to install to different Python versions. For example, to install to Python 3.3 if you have Python 2.7 installed:

(Invoke-WebRequest https://bootstrap.pypa.io/ez_setup.py).Content | py -3 -

Once installed run as follows:

easy_install semanticnet

我认为您尚未安装该模块。.首先尝试在Prompt Command上pip install semanticnet (我相信您在安装python时安装了pip),然后在安装完成后,只需运行python并尝试一些“ import语义网”在python命令行上...

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