#🔒 Trouble installing packages
123 messages · Page 1 of 1 (latest)
@uneven dock
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
Are you on VSCode? it may be as simple as selecting another interpreter (near the bottom right)
Anytime haha
wait, it only works with python 3.9.6 which doesn't support qiskit, any ideas on how i can get it to work with my 3.11.11 intepreter?
Are you on windows?
mac
What does python -V, pip -V and pip3 -V display?
pip 21.2.4 from /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/site-packages/pip (python 3.9)
Does python3 -V print anything?
Python 3.9.6
How'd you install 3.11?
you have pyenv so that's great, one sec ill go through the docs
alright thanks
Try running pyenv global 3.11.11
That should make 3.11 your default instead of your system 3.9 python
zsh: command not found: pyenv
do you have pip installed?
what does echo $PATH print for you?
in cmd, do "py -m pip install --upgrade pip", then do "py -m pip install [package_name]"
/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin
They're on a mac
oh my bad
np
Homebrew usually symlinks python3 and pip3 - it's odd that it didn't
Does echo $PYENV_ROOT print anything?
what library are you trying to download?
its probably simpler to re-install pyenv and set its version
nope
qiskit and matplotlib
alright shall i give that a go
try "python3 -m pip install <package-name>"
ive just switched back to my pyenv interperter and now its saying numpy cant be rsolved even tho it was fine before
https://github.com/pyenv/pyenv#a-getting-pyenv from this you should need to run the following:
brew update
brew install pyenv --head
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(pyenv init - zsh)"' >> ~/.zshrc
exec "$SHELL"
pyenv global 3.11.11
you can run these one by one
so just run each one
yeeeep
okay
After you do that, try running the version commands I posted earlier to make sure everything's in-sync
bro do you have multiple python versions? like 1.12 and 1.13
try changing your interpreter
i tried but the library i want to use doesnt work with python 3.9.6
which is the only working interpreter for that libarry
@spiral arch ive tried running this echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc got an error message then sent it agin and now it does nothing
that shouldnt error out
zsh: no such file or directory: /Users/emlynphoenix/.zshrc/Users/emlynphoenix/.pyenv/versions/3.11.11/bin/python
are you running those one-by-one? order matters
that error also doesnt seem to be caused by the command you just sent
yeah i ran one by one
could you paste a terminal dump into the pastebin maybe? from the point where you started running these
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshr is that the correct command
oh i kinda killed to termincal cuz when i tried to send that command again nothing would happen
yes, that adds a line into your shell configuration file
try cat ~/.zshrc
and just paste thee last few lines of the output
export PYENV_ROOT="$HOME/.pyenv"
export PYENV_ROOT="$HOME/.pyenv"
export PYENV_ROOT="$HOME/.pyenv"
export PYENV_ROOT="$HOME/.pyenv"
export PYENV_ROOT="$HOME/.pyenv"
yep that command won't produce any output, but it worked
no worries the duplicated lines wont hurt so you can keep going
ok ran them all
if you didnt see any red lines youre probably good
you can try those version commands from earlier
python3, pip, python, pip3 with the -v / -V flag
whoops
what did pyenv global 3.11.11 print?
you can run it again if you lost the output
nothing
what about pyenv versions
wait they do
i just killed the terminal
- 3.11.11 (set by PYENV_VERSION environment variable)
pip3 -V: pip 24.0 from /Users/emlynphoenix/.pyenv/versions/3.11.11/lib/python3.11/site-packages/pip (python 3.11)
python3 -V: Python 3.11.11
great, it should be the same for pip and python too
well to summarize what we did
pyenv lets you manage python versions, so pyenv is set to 3.11.11 currently which makes that your default python version
sooo now you canpip install whatever packages you need and make sure to select the pyenv 3.11.11 version
and that should hopefully fix your errors
if its ssying to update my pip should i?
i have completely lost track on what is going on here lol
i just ran these commands
sure, usually unnecessary though
(optional) if your libraries work on newer python versions, you can install a newer python version through pyenv and use that - that would be recommended (it would be something like pyenv install 3.13.2 & pyenv global 3.13.2
Managing python versions and virtualenvs is definitely top 10 in my list of frustrations (uv makes it better tho)
yep that should work for now
fr i hate whenver this happens cuz i have 0 clue on how to fix
however it all seems to be working so thanks very much for your help
No worries just make sure to keep using pyenv haha, even if you need newer versions, dont mix it with homebrew or anything else
im visualising a qubit 😉
alright thanksss
how do i close this?
do !close
oh ok... WAIT WHA-
This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.