0

If been trying to create a standalone version of my project. I've been able to create the setup file and the alias app with py2app with no problems. Running the alias app works without problems. However, when creating the independent file the app does not run any more.

First of all the error i receive upon opening the app is as follows:

File "scrapy/__init__.pyc", line 10, in <module>
File "pkgutil.pyc", line 616, in get_data
File "importlib/util.pyc", line 83, in find_spec
AttributeError: 'NoneType' object has no attribute 'startswith'

As the first line points to the scrapy module i tried to recreate the problem with an empty project.

As expected the empty project works flawless. The app runs independently without any errors. Until adding the scrapy framework. I made this little script trying to recreate the problem:

import scrapy

if __name__ == '__main__':
    scrapy.Request("http://www.google.com")

With this file i tried to create the independent app again, and as expected it crashes with the same error as above.

Any help regarding this problem will be greatly appreciated.

UPDATE

As suggested by user5214530, I have tried to create the standalone app with pyinstaller and the --onefile command. Sadly, I did get similar results as before.

File "site-packages/scrapy/__init__.py", line 10, in <module>
File "pkgutil.py", line 634, in get_data
File "/Users/.../Test/venv/lib/python3.6/site-packages/PyInstaller/loader/pyimod03_importers.py", line 479, in get_data
with open(path, 'rb') as fp:
FileNotFoundError: [Errno 2] No such file or directory: '/var/folders/mz/rg4w2jjj2zj5rtvnv8lxby2w0000gn/T/_MEIiGJyET/scrapy/VERSION'

As you may see I tried this with the simple test script with only scrapy in it and it also fails. May it be a problem with scrapy?

J.Paravicini
  • 882
  • 12
  • 39

1 Answers1

0

I would suggest you use pyinstaller instead, with --onefile command.

1.) pip install pyinstaller
2.) pyinstaller --onefile script.py

user5214530
  • 467
  • 5
  • 11
  • Thanks for the answer, i have already tried pyinstaller multiple times. I have tried it now with the --onefile command. Sadly it is a similar result. I'll update my question to better see the new errors. – J.Paravicini Jun 13 '18 at 16:05
  • I had similar issues like you with py2exe, but switching to pyinstaller solved problem for me. in the meanwhile, you can check out next link: https://stackoverflow.com/questions/16131500/py2app-error-in-find-needed-modules-typeerror-nonetype-object-has-no-attribu – user5214530 Jun 13 '18 at 16:15
  • Thanks for the link, however, the installation process works fine, the error occurs on opening the app. Therefore i can't really enter into the python console. I may be wrong tho – J.Paravicini Jun 13 '18 at 16:24