Skip to content
This repository has been archived by the owner on Apr 6, 2024. It is now read-only.

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

AttributeError: 'zipimport.zipimporter' object has no attribute 'exec_module' #36

Closed
cbdmaul opened this issue Oct 14, 2020 · 4 comments

Comments

@cbdmaul
Copy link

cbdmaul commented Oct 14, 2020

Get this error trying to run module. Seems to happen no matter what. Maybe changes since Python>3.5 based on this project's error? https://gitlab.kitware.com/vtk/vtk/-/merge_requests/6177

$ typer name_of_my_module run
Traceback (most recent call last):
File "/usr/local/bin/typer", line 8, in
sys.exit(main())
File "/usr/local/lib/python3.6/dist-packages/typer_cli/main.py", line 306, in main
return app()
File "/usr/local/lib/python3.6/dist-packages/typer/main.py", line 214, in call
return get_command(self)(*args, **kwargs)
File "/home/h/.local/lib/python3.6/site-packages/click/core.py", line 829, in call
return self.main(*args, **kwargs)
File "/home/h/.local/lib/python3.6/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.6/dist-packages/typer_cli/main.py", line 66, in invoke
self.maybe_add_run(ctx)
File "/usr/local/lib/python3.6/dist-packages/typer_cli/main.py", line 71, in maybe_add_run
maybe_add_run_to_cli(self)
File "/usr/local/lib/python3.6/dist-packages/typer_cli/main.py", line 144, in maybe_add_run_to_cli
obj = get_typer_from_state()
File "/usr/local/lib/python3.6/dist-packages/typer_cli/main.py", line 136, in get_typer_from_state
spec.loader.exec_module(module) # type: ignore
AttributeError: 'zipimport.zipimporter' object has no attribute 'exec_module'

Versions:

Python 3.6.9 (default, Jul 17 2020, 12:50:27)
[GCC 8.4.0] on linux

Requirement already up-to-date: typer in /usr/local/lib/python3.6/dist-packages (0.3.2)
Requirement already satisfied, skipping upgrade: click<7.2.0,>=7.1.1 in /home/h/.local/lib/python3.6/site-packages (from typer) (7.1.2)

Collecting typer-cli
Downloading typer_cli-0.0.11-py3-none-any.whl (8.9 kB)
Requirement already satisfied, skipping upgrade: colorama<0.5.0,>=0.4.3 in /usr/local/lib/python3.6/dist-packages (from typer-cli) (0.4.3)
Requirement already satisfied, skipping upgrade: shellingham<2.0.0,>=1.3.2 in /usr/local/lib/python3.6/dist-packages (from typer-cli) (1.3.2)
Requirement already satisfied, skipping upgrade: importlib_metadata<3.0,>=1.5 in /usr/local/lib/python3.6/dist-packages (from typer-cli) (1.7.0)
Requirement already satisfied, skipping upgrade: typer<0.4.0,>=0.3.0 in /usr/local/lib/python3.6/dist-packages (from typer-cli) (0.3.2)
Requirement already satisfied, skipping upgrade: zipp>=0.5 in /home/h/.local/lib/python3.6/site-packages (from importlib_metadata<3.0,>=1.5->typer-cli) (0.5.2)
Requirement already satisfied, skipping upgrade: click<7.2.0,>=7.1.1 in /home/h/.local/lib/python3.6/site-packages (from typer<0.4.0,>=0.3.0->typer-cli) (7.1.2)
Installing collected packages: typer-cli
Attempting uninstall: typer-cli
Found existing installation: typer-cli 0.0.10
Uninstalling typer-cli-0.0.10:
Successfully uninstalled typer-cli-0.0.10
Successfully installed typer-cli-0.0.11

@LVSant
Copy link

LVSant commented Mar 16, 2022

Also facing this issue.

@LVSant
Copy link

LVSant commented Mar 16, 2022

I'm using pipenv. To fix this, I just did pipenv --rm and reinstalled everything again, including typer-cli and it worked.

@cdcadman
Copy link
Contributor

I think this issue has been fixed in the python standard library: https://bugs.python.org/issue42131

@M1aoLiu
Copy link

M1aoLiu commented Oct 7, 2023

You can reduce the version of the package "Markdown". I also meet this problem, then I uninstall "Markdown" which is 3.5 and reinstall a new one which is 3.1.

Repository owner locked and limited conversation to collaborators Apr 6, 2024
@tiangolo tiangolo converted this issue into discussion #144 Apr 6, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants