Can't import module in python

WarSensation

I'm trying to use this python library in my website. Now, I've downloaded the sc2reader-0.6.5-py3.3.egg file and transferred the sc2reader folder in some random directory on my FTP account. I've also created files called test.py and test.php in the same directory. Test.php executes the test.py, and test.py imports the sc2reader library.

This is the code in the test.py:

import sys
import sc2reader
print 'Works'

And it doesn't run, if I remove the second line (import sc2reader), it runs just fine.

The directory structure looks like this:

/random_dir
L________/sc2reader
         L_____ __init__.py
         L______/other_stuff
L________test.py
L________test.php

Any help is much appreciated. :P

mkorcha

From the docs of sc2reader:

Install from the latest release on PyPI with pip:

pip install sc2reader

or easy_install:

easy_install sc2reader

The egg file you downloaded is meant to be installed using easy_install. You can do this by running:

easy_install sc2reader-0.6.5-py3.3.egg.

I would recommend just installing with pip under virtualenv. That way, when Python or a library you use is updated, your environment doesn't change with them and your application will continue to work.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Can't import module in python

From Dev

Can't import custom Python module using Eclipse

From Dev

Can't import own python module in Postgresql plpython function

From Dev

root able to import python module, but user can't

From Dev

Can't import custom python module using multiprocess library

From Dev

Why can't I import this Haskell module?

From Dev

Can't import package "No module named <modulename>"

From Dev

Can't import module created using SWIG

From Dev

Why I can't import this module

From Dev

Can't import ggplot module in iPython

From Dev

I can't import a module without errors

From Dev

Can't import package "No module named <modulename>"

From Dev

Can’t import a module within my virtualenv

From Dev

Node can't import npm installed module

From Dev

Can't import turtle module in Python 2.x and Python 3.x

From Java

pytest cannot import module while python can

From Dev

pytest cannot import module while python can

From Dev

Can't import a module from another crate - unresolved import

From Dev

Can't import a module from another crate - unresolved import

From Dev

Can't Import Python Class

From Dev

Can't import soundfile python

From Dev

can't import GoogleMaps in python

From Dev

Python - can't import pandas

From Dev

Python can't import tika

From Dev

Can't find '_sqlite3' module when import it using python which installed by pyenv

From Dev

Can't find module in python

From Dev

py.test can't import my module

From Dev

Can't import my own module distributed with distutils

From Dev

Installed PySide but can't import it: "no module named PySide"