Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not installing module #21

Open
andystevensname opened this issue Oct 31, 2015 · 3 comments
Open

Not installing module #21

andystevensname opened this issue Oct 31, 2015 · 3 comments

Comments

@andystevensname
Copy link

This is a noob question. I was able to use the epsonprinter module when I included my scripts within the epson_printer folder, but after multiple attempts at using the setup script I'm unable to include the epsonprinter module in other scripts outside of the epson_printer folder. Is there a folder I should move manually to dist-packages? I ran the code provided here. Here's my full install log:

~/python-epson-printer $ sudo python setup.py install
running install
Checking .pth file support in /usr/local/lib/python2.7/dist-packages/
/usr/bin/python -E -c pass
TEST PASSED: /usr/local/lib/python2.7/dist-packages/ appears to support .pth files
running bdist_egg
running egg_info
writing requirements to python_epson_printer.egg-info/requires.txt
writing python_epson_printer.egg-info/PKG-INFO
writing top-level names to python_epson_printer.egg-info/top_level.txt
writing dependency_links to python_epson_printer.egg-info/dependency_links.txt
reading manifest file 'python_epson_printer.egg-info/SOURCES.txt'
writing manifest file 'python_epson_printer.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-armv7l/egg
running install_lib
running build_py
creating build/bdist.linux-armv7l/egg
creating build/bdist.linux-armv7l/egg/epson_printer
copying build/lib.linux-armv7l-2.7/epson_printer/testpage.py -> build/bdist.linux-armv7l/egg/epson_printer
copying build/lib.linux-armv7l-2.7/epson_printer/epsonprinter.py -> build/bdist.linux-armv7l/egg/epson_printer
copying build/lib.linux-armv7l-2.7/epson_printer/init.py -> build/bdist.linux-armv7l/egg/epson_printer
byte-compiling build/bdist.linux-armv7l/egg/epson_printer/testpage.py to testpage.pyc
byte-compiling build/bdist.linux-armv7l/egg/epson_printer/epsonprinter.py to epsonprinter.pyc
byte-compiling build/bdist.linux-armv7l/egg/epson_printer/init.py to init.pyc
creating build/bdist.linux-armv7l/egg/EGG-INFO
copying python_epson_printer.egg-info/PKG-INFO -> build/bdist.linux-armv7l/egg/EGG-INFO
copying python_epson_printer.egg-info/SOURCES.txt -> build/bdist.linux-armv7l/egg/EGG-INFO
copying python_epson_printer.egg-info/dependency_links.txt -> build/bdist.linux-armv7l/egg/EGG-INFO
copying python_epson_printer.egg-info/requires.txt -> build/bdist.linux-armv7l/egg/EGG-INFO
copying python_epson_printer.egg-info/top_level.txt -> build/bdist.linux-armv7l/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating 'dist/python_epson_printer-1.7.1-py2.7.egg' and adding 'build/bdist.linux-armv7l/egg' to it
removing 'build/bdist.linux-armv7l/egg' (and everything under it)
Processing python_epson_printer-1.7.1-py2.7.egg
removing '/usr/local/lib/python2.7/dist-packages/python_epson_printer-1.7.1-py2.7.egg' (and everything under it)
creating /usr/local/lib/python2.7/dist-packages/python_epson_printer-1.7.1-py2.7.egg
Extracting python_epson_printer-1.7.1-py2.7.egg to /usr/local/lib/python2.7/dist-packages
python-epson-printer 1.7.1 is already the active version in easy-install.pth

Installed /usr/local/lib/python2.7/dist-packages/python_epson_printer-1.7.1-py2.7.egg
Processing dependencies for python-epson-printer==1.7.1
Searching for Pillow==2.6.0
Best match: Pillow 2.6.0
Processing Pillow-2.6.0-py2.7-linux-armv7l.egg
Pillow 2.6.0 is already the active version in easy-install.pth
Installing pilfile.py script to /usr/local/bin
Installing pildriver.py script to /usr/local/bin
Installing pilconvert.py script to /usr/local/bin
Installing pilprint.py script to /usr/local/bin
Installing pilfont.py script to /usr/local/bin

Using /usr/local/lib/python2.7/dist-packages/Pillow-2.6.0-py2.7-linux-armv7l.egg
Searching for pyusb==1.0.0b1
Best match: pyusb 1.0.0b1
pyusb 1.0.0b1 is already the active version in easy-install.pth

Using /usr/local/lib/python2.7/dist-packages
Finished processing dependencies for python-epson-printer==1.7.1

@benoitguigal
Copy link
Owner

After running python setup.py install you should be able to import the epsonprinter module with from epson_printer import epsonprinter at the top of the script.

@andystevensname
Copy link
Author

Unfortunately, I cannot use the from epson_printer import epsonprinter command. I might have botched something up on my RPi. Everything looks to be installed via the installer, but I can't find the folder anywhere in my dist-packages. Can I manually move the epson_printer folder to my dist-packages? Or perhaps the epson_printer file in the build/lib.linux_arm7l-2.7 folder? I'm not sure what else it takes to perform a module install. I'm very sorry to bother you with these petty chores, I'm rather new to all of this.

@jonalxh
Copy link

jonalxh commented May 7, 2018

@benoitguigal Thanks to your answer I've been able to import the module, but how to print after instantiate?
I'm trying:
printer = epsonprinter(0x04b8, 0x0202)
printer.print_text("Hello")
But it shows me:
TypeError: 'module' object is not callable

Thanks a lot for your help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants