Psycopg2 mac m112/27/2023 If you see that output then congratulations! You've succesfully set up python under rosetta! This should now output `/Users/damian/.pyenv/shims/python: Bourne-Again shell script text executable, ASCII text` To make sure everything is set type the following into the terminal. Now close and open your terminal to apply the changes. Now open the zprofile file `code ~/.zprofile` and paste the following into it (if it's not already there) `eval "$(pyenv init -)"` or uncomment it if you haven't commented-out. You'll find these instructions on week 17 and 18 on a/A open.Īfter all of that is complete you can open your zshrc file `code ~/.zshrc` and paste the following in there. Now follow the entire installation process for pyenv on macOS and then follow the entire installation process for pipenv on macOS in that order. If it doesn't then close and open the terminal. Run the following command in the terminal: You should see Homebrew inside there now. Now that we're in the correct arch, we can begin installing homebrew.Ĭlose and open your terminal now and enter the following: # *If you want this to be permanent make sure to right click the terminal icon on your desktop (if it's not there then drag and drop it there) and click on "get info" and check the "open using rosetta" option.* If you type `arch` into your terminal it should now be `i3864` or `x86_64` (anything other than `arm64` means it was successful) This will switch your arch from arm64 to x86_64. (if the previous command didn't work then run the following to install rosetta`/usr/sbin/softwareupdate -install-rosetta -agree-to-license`) (save this command in your notes incase you ever need it) ```cd: no such file or directory: /usr/local/Homebrew/``` then this step is for you. **If succesfully entered the directory then skip this step!** > Example of the type of paths we want to delete or comment-out:Īnd do the same thing here as you did with the zshrc (remove all opt/homebrew paths) (opt/homebrew is the path to the M1 version of homebrew and will interfere in the way of brew installations) In this file we are going to comment out any PATH that begins with 'opt/homebrew' Then congrats you've succesfully removed pyenv and pipenv from your life. If the output is NOT /Users//.pyenv/shims/python To make sure pyenv and pipenv were deleted properly, type the following into your terminal: ( comment out any eval(pyenv) )Įxecute the following command in your terminal: (If you haven't installed pyenv and pipenv then skip to step 3)Ĭomment out the following lines if you have themĪnd do the same thing there as you did with the zshrc file. **Now close and reopen your terminal to apply changes.** (this is to make sure the ```code``` command still functions in the terminal when we start the process of manipulating the zshrc and zprofile files) Type in "Shell command" and select the option that states "install 'code' command in PATH". Open VS Code and press ``` cmd + shft + p``` this will open a bar on the top of VSC. If the output for this is **usr/local/bin/brew** then congratulations! You're already using the rosetta version of brew. (If your output for the previous step was arm64 skip this step) # For those that already have Rosetta set up This command will either output **arm64** (meaning you're currently using the M1 native terminal) or **i3864** (meaning that you're already running under Rosetta) Run the following command in your terminal: Left the same comment in discussion #270.The architecture the M1 mac uses is incompatible with many essential programming tools including psycopg2 (an essential part in getting python to work with the postgres database). OperationalError: connection failed: :18a0:6af2:b15d:b7c8), port 5432 failed: could not receive data from server: Connection refused > 1 ~/Library/Python/3.11/lib/python/site-packages/psycopg/connection.py:728, in nnect(cls, conninfo, autocommit, prepare_threshold, row_factory, cursor_factory, context, **kwargs)ħ24 cls._connect_gen(conninfo, autocommit=autocommit),
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |