[GH-ISSUE #38] AttributeError: 'module' object has no attribute 'TemporaryDirectory' #37

Closed
opened 2026-02-26 12:20:16 +03:00 by kerem · 13 comments
Owner

Originally created by @VogelPapaFinn on GitHub (Dec 14, 2018).
Original GitHub issue: https://github.com/brentvollebregt/auto-py-to-exe/issues/38

After I downloaded it from GitHub, installed it and opened it, an error occured:
Traceback (most recent call last):
File "/usr/local/bin/auto-py-to-exe", line 11, in
load_entry_point('auto-py-to-exe==2.4.3', 'console_scripts', 'auto-py-to-exe')()
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 487, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 2728, in load_entry_point
return ep.load()
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 2346, in load
return self.resolve()
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 2352, in resolve
module = import(self.module_name, fromlist=['name'], level=0)
File "/usr/local/lib/python2.7/dist-packages/auto_py_to_exe-2.4.3-py2.7.egg/auto_py_to_exe/main.py", line 107, in
temporary_directory = tempfile.TemporaryDirectory()
AttributeError: 'module' object has no attribute 'TemporaryDirectory'

I installed it with "python setup.py install". I have python 2.7.15+ and python 3.6.7. I use Kali Linux 2018!
Thx

Originally created by @VogelPapaFinn on GitHub (Dec 14, 2018). Original GitHub issue: https://github.com/brentvollebregt/auto-py-to-exe/issues/38 After I downloaded it from GitHub, installed it and opened it, an error occured: Traceback (most recent call last): File "/usr/local/bin/auto-py-to-exe", line 11, in <module> load_entry_point('auto-py-to-exe==2.4.3', 'console_scripts', 'auto-py-to-exe')() File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 487, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2728, in load_entry_point return ep.load() File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2346, in load return self.resolve() File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2352, in resolve module = __import__(self.module_name, fromlist=['__name__'], level=0) File "/usr/local/lib/python2.7/dist-packages/auto_py_to_exe-2.4.3-py2.7.egg/auto_py_to_exe/__main__.py", line 107, in <module> temporary_directory = tempfile.TemporaryDirectory() AttributeError: 'module' object has no attribute 'TemporaryDirectory' I installed it with "python setup.py install". I have python 2.7.15+ and python 3.6.7. I use Kali Linux 2018! Thx
kerem closed this issue 2026-02-26 12:20:16 +03:00
Author
Owner

@brentvollebregt commented on GitHub (Dec 14, 2018):

Ah yes, I had assumed this new feature would work with Python 2.7 but never tested it. tempfile.TemporaryDirectory was added in Python 3.2 so I will need to use something a bit older to keep support for Python 2.7.

<!-- gh-comment-id:447513885 --> @brentvollebregt commented on GitHub (Dec 14, 2018): Ah yes, I had assumed this new feature would work with Python 2.7 but never tested it. `tempfile.TemporaryDirectory` was added in Python 3.2 so I will need to use something a bit older to keep support for Python 2.7.
Author
Owner

@brentvollebregt commented on GitHub (Dec 15, 2018):

I believe I have fixed this issue at 6b056be and have merged the branch it was on into master.

Could you please test this and verify that the temporary directory is being created and deleted when the project is closed? The temporary directory will be displayed in the output when packaging a script.

<!-- gh-comment-id:447520210 --> @brentvollebregt commented on GitHub (Dec 15, 2018): I believe I have fixed this issue at 6b056be and have merged the branch it was on into master. Could you please test this and verify that the temporary directory is being created and deleted when the project is closed? The temporary directory will be displayed in the output when packaging a script.
Author
Owner

@VogelPapaFinn commented on GitHub (Dec 15, 2018):

Now another error occurs:
Traceback (most recent call last): File "/usr/local/bin/auto-py-to-exe", line 7, in <module> from auto_py_to_exe.__main__ import run File "/usr/local/lib/python2.7/dist-packages/auto_py_to_exe/__main__.py", line 21, in <module> except ModuleNotFoundError: NameError: name 'ModuleNotFoundError' is not defined

<!-- gh-comment-id:447588449 --> @VogelPapaFinn commented on GitHub (Dec 15, 2018): Now another error occurs: `Traceback (most recent call last): File "/usr/local/bin/auto-py-to-exe", line 7, in <module> from auto_py_to_exe.__main__ import run File "/usr/local/lib/python2.7/dist-packages/auto_py_to_exe/__main__.py", line 21, in <module> except ModuleNotFoundError: NameError: name 'ModuleNotFoundError' is not defined `
Author
Owner

@brentvollebregt commented on GitHub (Dec 15, 2018):

Are you testing using the latest on master? I thought I had fixed this quite a while ago.

<!-- gh-comment-id:447590985 --> @brentvollebregt commented on GitHub (Dec 15, 2018): Are you testing using the latest on master? I thought I had fixed this quite a while ago.
Author
Owner

@VogelPapaFinn commented on GitHub (Dec 15, 2018):

Yes

<!-- gh-comment-id:447591185 --> @VogelPapaFinn commented on GitHub (Dec 15, 2018): Yes
Author
Owner

@brentvollebregt commented on GitHub (Dec 15, 2018):

In 6ef7c752d1 this was fixed, the name ModuleNotFoundError doesn't even exist in the project anymore. Also you should have hit this error before finding the AttributeError related to TemporaryDirectory you found before as this check occurs before the creation of the temporary directory.

<!-- gh-comment-id:447591638 --> @brentvollebregt commented on GitHub (Dec 15, 2018): In 6ef7c752d1aa1b01625798900cd58aa83a45ef69 this was fixed, the name `ModuleNotFoundError` doesn't even exist in the project anymore. Also you should have hit this error before finding the `AttributeError` related to `TemporaryDirectory` you found before as this check occurs before the creation of the temporary directory.
Author
Owner

@VogelPapaFinn commented on GitHub (Dec 15, 2018):

So what should I do now?

<!-- gh-comment-id:447591835 --> @VogelPapaFinn commented on GitHub (Dec 15, 2018): So what should I do now?
Author
Owner

@brentvollebregt commented on GitHub (Dec 15, 2018):

Make sure you are on the master branch. What method are you using to download the project? git, pip, zip download or something else?

<!-- gh-comment-id:447592157 --> @brentvollebregt commented on GitHub (Dec 15, 2018): Make sure you are on the master branch. What method are you using to download the project? git, pip, zip download or something else?
Author
Owner

@brentvollebregt commented on GitHub (Dec 17, 2018):

Please note that the latest version of master has not been put on PyPI.

<!-- gh-comment-id:447777262 --> @brentvollebregt commented on GitHub (Dec 17, 2018): Please note that the latest version of master has not been put on PyPI.
Author
Owner

@VogelPapaFinn commented on GitHub (Dec 18, 2018):

fixed it by doing the installation with python2.7. But after I want to start the program the console is "loading" but nothing happen nothing. I have installed chrome with this tutorial

<!-- gh-comment-id:448270315 --> @VogelPapaFinn commented on GitHub (Dec 18, 2018): fixed it by doing the installation with python2.7. But after I want to start the program the console is "loading" but nothing happen nothing. I have installed chrome with <a href=https://linuxconfig.org/how-to-install-google-chrome-browser-on-kali-linux>this</a> tutorial
Author
Owner

@brentvollebregt commented on GitHub (Dec 18, 2018):

Wasn't Python 2.7 the original issue? You now have me confused; all these tracebacks are Python 2.7.

You stating that you have to install Chrome using a tutorial is hinting to me that this cannot find your Chrome distribution. Although when using Linux, Eel picks up google-chrome so it should be launching. Are you seeing any warnings?

<!-- gh-comment-id:448307756 --> @brentvollebregt commented on GitHub (Dec 18, 2018): Wasn't Python 2.7 the original issue? You now have me confused; all these tracebacks are Python 2.7. You stating that you have to install Chrome using a tutorial is hinting to me that this cannot find your Chrome distribution. Although when using Linux, Eel picks up `google-chrome` so it should be launching. Are you seeing any warnings?
Author
Owner

@VogelPapaFinn commented on GitHub (Dec 18, 2018):

Sorry that was my fault^^ I installed the program now on windows 10, there it was verry easy:)

<!-- gh-comment-id:448308643 --> @VogelPapaFinn commented on GitHub (Dec 18, 2018): Sorry that was my fault^^ I installed the program now on windows 10, there it was verry easy:)
Author
Owner

@brentvollebregt commented on GitHub (Dec 18, 2018):

Oh that's good. I'm still a bit curious about Kali Linux though, next time I'm using it I'll try it myself.

I'll close the issue for now but if anything comes up in regards to this issue, we can open it back up.

<!-- gh-comment-id:448312610 --> @brentvollebregt commented on GitHub (Dec 18, 2018): Oh that's good. I'm still a bit curious about Kali Linux though, next time I'm using it I'll try it myself. I'll close the issue for now but if anything comes up in regards to this issue, we can open it back up.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/auto-py-to-exe#37
No description provided.