cookiecutter-pyqt5 icon indicating copy to clipboard operation
cookiecutter-pyqt5 copied to clipboard

error module not found

Open ovitor opened this issue 7 years ago • 3 comments

Hi, I'm trying to start develop an application using your cookie cutter template, but I got the following error:

I'm inside a virtualenv with python 3.7, is this a problem?

pdfeditor $ python pdfeditor/application.py
Traceback (most recent call last):
  File "/home/vitor/projects/pdfeditor/venv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 354, in get_provider
    module = sys.modules[moduleOrReq]
KeyError: 'pdfeditor.images'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "pdfeditor/application.py", line 130, in <module>
    main()
  File "pdfeditor/application.py", line 121, in main
    window = PDFEditor()
  File "pdfeditor/application.py", line 27, in __init__
    self.about_dialog = AboutDialog()
  File "pdfeditor/application.py", line 96, in __init__
    'ic_help_black_48dp_1x.png')
  File "/home/vitor/projects/pdfeditor/venv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 1139, in resource_filename
    return get_provider(package_or_requirement).get_resource_filename(
  File "/home/vitor/projects/pdfeditor/venv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 356, in get_provider
    __import__(moduleOrReq)
ModuleNotFoundError: No module named 'pdfeditor'

ovitor avatar Oct 26 '18 19:10 ovitor

This looks like a packaging error in that pkg_resources cannot find your pdfeditor module. It's hard to say the exact cause without more details. Make sure you've defined your packages correctly in setup.py.

mandeep avatar Oct 26 '18 20:10 mandeep

This is a new project, I didn't installed any other library. The commands executed was:

$ cookiecutter https://github.com/mandeep/cookiecutter-pyqt5.git
$ cd pdfeditor
$ virtualenv --python=python3 --no-site-packages venv
$ source ./venv/bin/activate
$ pip3 install pyqt5
$ python pdfeditor/application.py

My setup.py file is identical the cookiecutter template.

ovitor avatar Oct 30 '18 17:10 ovitor

Right. You want to install your application via a command like pip install . and then use the entry point you specified when running cookiecutter to open the application.

mandeep avatar Nov 01 '18 21:11 mandeep