Release 3.10.1 (macos/homebrew): ModuleNotFoundError: No module named 'yaml'
dgrebb opened this issue · 7 comments
Description
Perhaps virtualenv dependency issue with python 3.12?
Fix
brew tap-new $USER/local-commitizenbrew tap homebrew/corebrew extract --version=3.10.0 commitizen $USER/local-commitizenHOMEBREW_NO_AUTO_UPDATE=1 brew install $USER/local-commitizen/commitizen@3.10.0(HOMEBREW_NO_AUTO_UPDATEis personal preference to be unset later)cz version->3.10.0- :)
Steps to reproduce
- Install commitizen via homebrew
brew install commitizen - Run
cz ModuleNotFoundError: No module named 'yaml'
Current behavior
❯ cz
Traceback (most recent call last):
File "/opt/homebrew/bin/cz", line 5, in <module>
from commitizen.cli import main
File "/opt/homebrew/Cellar/commitizen/3.10.1/libexec/lib/python3.12/site-packages/commitizen/__init__.py", line 6, in <module>
from commitizen.cz.base import BaseCommitizen
File "/opt/homebrew/Cellar/commitizen/3.10.1/libexec/lib/python3.12/site-packages/commitizen/cz/__init__.py", line 10, in <module>
from commitizen.cz.base import BaseCommitizen
File "/opt/homebrew/Cellar/commitizen/3.10.1/libexec/lib/python3.12/site-packages/commitizen/cz/base.py", line 9, in <module>
from commitizen.config.base_config import BaseConfig
File "/opt/homebrew/Cellar/commitizen/3.10.1/libexec/lib/python3.12/site-packages/commitizen/config/__init__.py", line 10, in <module>
from .yaml_config import YAMLConfig
File "/opt/homebrew/Cellar/commitizen/3.10.1/libexec/lib/python3.12/site-packages/commitizen/config/yaml_config.py", line 5, in <module>
import yaml
ModuleNotFoundError: No module named 'yaml'Desired behavior
Standard functionality.
Screenshots
No response
Environment
Homebrew Health
(below warning ok as commitizen is no longer from origin)
❯ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!
Warning: Some taps are not on the default git origin branch and may not receive
updates. If this is a surprise to you, check out the default branch with:
git -C $(brew --repo dgrebb/local-commitizen) checkoutHomebrew Details
❯ brew config
HOMEBREW_VERSION: 4.1.15-36-gc0c8a4d
ORIGIN: https://github.com/Homebrew/brew
HEAD: c0c8a4dd4dd19ec16deb429abd50cdf82ea33b27
Last commit: 32 hours ago
Core tap origin: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 16ffa0a31c87d9bdfab5aa8f3d9f031791c12cd6
Core tap last commit: 22 minutes ago
Core tap branch: master
Core tap JSON: 16 Oct 00:47 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 10
HOMEBREW_SORBET_RUNTIME: set
Homebrew Ruby: 2.6.10 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: 10-core 64-bit arm_firestorm_icestorm
Clang: 15.0.0 build 1500
Git: 2.42.0 => /opt/homebrew/bin/git
Curl: 8.1.2 => /usr/bin/curl
macOS: 14.0-arm64
CLT: 15.0.0.0.1.1694021235
Xcode: 15.0
Rosetta 2: falsePython
❯ python3 -c "import platform; print(platform.system())"
DarwinMac Specifics
❯ system_profiler SPSoftwareDataType SPHardwareDataType
Software:
System Software Overview:
System Version: macOS 14.0 (23A344)
Kernel Version: Darwin 23.0.0
Boot Volume: Macintosh HD
Boot Mode: Normal
Computer Name:
User Name:
Secure Virtual Memory: Enabled
System Integrity Protection: Disabled
Time since boot: 1 hour, 18 minutes
Hardware:
Hardware Overview:
Model Name: MacBook Pro
Model Identifier: MacBookPro18,4
Model Number:
Chip: Apple M1 Max
Total Number of Cores: 10 (8 performance and 2 efficiency)
Memory: 64 GB
System Firmware Version: 10151.1.1
OS Loader Version: 10151.1.1Thank you for a wonderful project and tool! Hope this helps, and happy to contribute to triage.
I'm gonna take a look 👀 💪🏻
After installing pyyaml
python3 -m pip install pyyaml
cz version --report
Traceback (most recent call last):
File "/opt/homebrew/bin/cz", line 5, in <module>
from commitizen.cli import main
File "/opt/homebrew/Cellar/commitizen/3.10.1/libexec/lib/python3.12/site-packages/commitizen/cli.py", line 13, in <module>
from commitizen import commands, config, out, version_schemes
File "/opt/homebrew/Cellar/commitizen/3.10.1/libexec/lib/python3.12/site-packages/commitizen/commands/__init__.py", line 1, in <module>
from .bump import Bump
File "/opt/homebrew/Cellar/commitizen/3.10.1/libexec/lib/python3.12/site-packages/commitizen/commands/bump.py", line 9, in <module>
from commitizen import bump, cmd, factory, git, hooks, out
File "/opt/homebrew/Cellar/commitizen/3.10.1/libexec/lib/python3.12/site-packages/commitizen/bump.py", line 11, in <module>
from commitizen.version_schemes import DEFAULT_SCHEME, Version, VersionScheme
File "/opt/homebrew/Cellar/commitizen/3.10.1/libexec/lib/python3.12/site-packages/commitizen/version_schemes.py", line 10, in <module>
from packaging.version import InvalidVersion # noqa: F401: Rexpose the common exception
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'packaging'Did you also have the same error? Did you both try to uninstall and install again?
I've got this working by running brew reinstall $(brew deps commitizen) commitizen to reinstall the dependencies
Did you also have the same error? Did you both try to uninstall and install again?
Yep. But this has worked for me to reinstall the dependencies - thanks
brew reinstall $(brew deps commitizen) commitizenI had the same problem with commitizen 3.12.0 after a brew upgrade
cz commit
Traceback (most recent call last):
File "/usr/local/bin/cz", line 5, in <module>
from commitizen.cli import main
File "/usr/local/Cellar/commitizen/3.12.0/libexec/lib/python3.12/site-packages/commitizen/__init__.py", line 6, in <module>
from commitizen.cz.base import BaseCommitizen
File "/usr/local/Cellar/commitizen/3.12.0/libexec/lib/python3.12/site-packages/commitizen/cz/__init__.py", line 10, in <module>
from commitizen.cz.base import BaseCommitizen
File "/usr/local/Cellar/commitizen/3.12.0/libexec/lib/python3.12/site-packages/commitizen/cz/base.py", line 10, in <module>
from commitizen.config.base_config import BaseConfig
File "/usr/local/Cellar/commitizen/3.12.0/libexec/lib/python3.12/site-packages/commitizen/config/__init__.py", line 10, in <module>
from .yaml_config import YAMLConfig
File "/usr/local/Cellar/commitizen/3.12.0/libexec/lib/python3.12/site-packages/commitizen/config/yaml_config.py", line 5, in <module>
import yaml
ModuleNotFoundError: No module named 'yaml'
Resolution
I've got this working by running
brew reinstall $(brew deps commitizen) commitizento reinstall the dependencies