#🔒 Trouble installing packages

123 messages · Page 1 of 1 (latest)

uneven dock
#

When trying to install packages like qiskit and matplotlib, after installing them it still says the packages aren't installed and cannot be resolved, i have no clue why

grand hearthBOT
#

@uneven dock

Python help channel opened

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.

spiral arch
#

Are you on VSCode? it may be as simple as selecting another interpreter (near the bottom right)

uneven dock
#

yeah, alright ill give tht a go

#

yep that seems to have workd, thanks haha

spiral arch
#

Anytime haha

uneven dock
# spiral arch 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?

spiral arch
#

Are you on windows?

uneven dock
#

mac

spiral arch
#

What does python -V, pip -V and pip3 -V display?

uneven dock
#

results only show for pip3

#

bit of a long msg tho, want me to send?

spiral arch
#

It shouldn't be long, maybe it's pip3 -v?

#

(lower case v)

uneven dock
#

pip 21.2.4 from /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/site-packages/pip (python 3.9)

spiral arch
#

Does python3 -V print anything?

uneven dock
spiral arch
#

How'd you install 3.11?

uneven dock
#

uhh, i cant really remember

#

thats my interpreters

spiral arch
#

you have pyenv so that's great, one sec ill go through the docs

uneven dock
#

alright thanks

spiral arch
#

Try running pyenv global 3.11.11

#

That should make 3.11 your default instead of your system 3.9 python

uneven dock
#

zsh: command not found: pyenv

rugged meteor
#

do you have pip installed?

uneven dock
#

yeah

#

well, pip3

spiral arch
#

what does echo $PATH print for you?

rugged meteor
# uneven dock yeah

in cmd, do "py -m pip install --upgrade pip", then do "py -m pip install [package_name]"

uneven dock
#

/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

rugged meteor
uneven dock
#

np

spiral arch
#

Homebrew usually symlinks python3 and pip3 - it's odd that it didn't

#

Does echo $PYENV_ROOT print anything?

rugged meteor
#

what library are you trying to download?

spiral arch
#

its probably simpler to re-install pyenv and set its version

uneven dock
uneven dock
uneven dock
rugged meteor
#

try "python3 -m pip install <package-name>"

uneven dock
#

ive just switched back to my pyenv interperter and now its saying numpy cant be rsolved even tho it was fine before

spiral arch
#

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

uneven dock
#

so just run each one

spiral arch
#

yeeeep

uneven dock
#

okay

spiral arch
#

After you do that, try running the version commands I posted earlier to make sure everything's in-sync

rugged meteor
#

bro do you have multiple python versions? like 1.12 and 1.13

uneven dock
#

yeah i think so

#

i have 2 interpreters with 2 dif versions

rugged meteor
#

try changing your interpreter

uneven dock
#

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

spiral arch
#

that shouldnt error out

uneven dock
#

zsh: no such file or directory: /Users/emlynphoenix/.zshrc/Users/emlynphoenix/.pyenv/versions/3.11.11/bin/python

spiral arch
#

are you running those one-by-one? order matters

#

that error also doesnt seem to be caused by the command you just sent

uneven dock
#

yeah i ran one by one

spiral arch
#

could you paste a terminal dump into the pastebin maybe? from the point where you started running these

uneven dock
#

echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshr is that the correct command

uneven dock
spiral arch
#

try cat ~/.zshrc

#

and just paste thee last few lines of the output

uneven dock
#

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"

spiral arch
#

yep that command won't produce any output, but it worked

uneven dock
#

ohh alright

#

i thought it wasnt working mb

spiral arch
#

no worries the duplicated lines wont hurt so you can keep going

uneven dock
#

ok ran them all

spiral arch
#

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

uneven dock
#

none seem to work now..

#

unless ive done smthn weird

spiral arch
#

whoops

#

what did pyenv global 3.11.11 print?

#

you can run it again if you lost the output

uneven dock
#

nothing

spiral arch
#

what about pyenv versions

uneven dock
#

i just killed the terminal

uneven dock
spiral arch
#

do they all display 3.11.11

#

the version commands

uneven dock
#

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

spiral arch
#

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

uneven dock
#

ohh ok

spiral arch
#

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

uneven dock
#

if its ssying to update my pip should i?

rugged meteor
#

i have completely lost track on what is going on here lol

spiral arch
#

(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

uneven dock
#

oh shall i do that?

#

may aswell

#

or actually

#

ill keep 3.11 for no

#

now

spiral arch
spiral arch
uneven dock
#

however it all seems to be working so thanks very much for your help

spiral arch
#

No worries just make sure to keep using pyenv haha, even if you need newer versions, dont mix it with homebrew or anything else

uneven dock
#

im visualising a qubit 😉

uneven dock
#

how do i close this?

rugged meteor
rugged meteor
uneven dock
#

i though itd be fun

#

using a bloch vector

#

anways

#

byeee

#

!close

grand hearthBOT
#
Python help channel closed with !close

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.