I'm using OSX. When I'm running python --version
or any other command which starts with the python
or pip
, I get this message
"dyld[19439]: rebase opcodes terminated early at offset 1 of 9040
I didn't find what that could be. I tried a few times to remove Python and install it again, but it didn't work.
Right now, I've added to my .zshrc the following:
alias python=/usr/bin/python3
alias python3=/usr/bin/python3
alias pip=/usr/bin/pip3
alias pip=/usr/bin/pip3
and looks like it works, but I have doubts about whether it's a good solution.
Important to note that provided fix doesn't fully resolve the issue. When I'm trying to run the nvim-dap-python the error log shows the following:
[ ERROR ] 2022-10-24T17:53:00Z 0300 ] ...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:1164 ] "stderr" {
args = { "-m", "debugpy.adapter" },
command = "/Users/..../api/.venv/bin/python",
type = "executable"
} "dyld[20328]: rebase opcodes terminated early at offset 1 of 9040\n"
[ INFO ] 2022-10-24T17:53:00Z 0300 ] ...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:1128 ] "Closed all handles"
[ INFO ] 2022-10-24T17:53:00Z 0300 ] ...nvim/site/pack/packer/start/nvim-dap/lua/dap/session.lua:1131 ] "Process closed" 20328 false
When I run which python
without aliases I'm getting this:
/Users/<user>/.pyenv/shims/python
CodePudding user response:
I've removed all Python versions and all aliases.
After I also removed the pyenv using brew
command.
After all these steps, I installed pyenv.
Using pyenv, I installed two python versions:
pyenv install 3.10.4
pyenv install 2.7.15
Finally, I set the python versions in the following way:
pyenv global 3.10.4 2.7.15
Seems that everything works now.