0

Good morning everyone,

MacBook Air 2017.

I am new to code, and I have just started to learn a few lines of Python. I had installed version 3.8 a few months ago, and now I have started learning a bit more seriously. I found out about the pip command, but trying to install the docx pip through "pip install python-docx" showed me an error.

To be completely honest, I started to watch on the internet how to fix this problem, but I didn't really understand what I was doing. I tried to install Pyenv to somehow correct the error by making Python 3.9.4 the default version for the Mac, following this website https://opensource.com/article/19/5/python-3-default-mac. I tried to modify the .bash trough "touch ~/.bash_profile; open ~/.bash_profile", hoping this would somehow fix the issue following How do I edit $PATH (.bash_profile) on OSX?. In the end, I just decided to uninstall both 3.8 and 3.9.4 to somehow start again through https://apple.stackexchange.com/questions/284824/remove-and-reinstall-python-on-mac-can-i-trust-these-old-references, but nothing happened. At this moment in time, I have no clue what happened and if somehow I have made things even worse (which I probably did).

Right now, whenever I use any command with pip an error comes up, and I don't know how to fix it in order to be able to use modules & pip in Python. The error could be the same as the following one that I have attached to the post, which comes up after writing commands in terminal: Image with a few errors

Thanks a lot, Bye.

Michele
  • 1
  • 1
  • 1
    use `python3 -v` or alias you have used for python in your bashrc profile – sahasrara62 Apr 08 '21 at 12:24
  • Ok, if I understood correctly I should write 'python3 -v' inside terminal, but if I do that, than I get space >>> to write something. What should I write in there? If I write for example 'pip install python-docx' I get a syntax error. – Michele Apr 08 '21 at 12:38
  • to install/use python3 use `python3 -m pip install python-docx` or `pip3 install python-doc` to use python 3.9 – sahasrara62 Apr 08 '21 at 12:53
  • Thanks a lot, I managed to install the pip. I still have some issues, but for the moment I was able to use modules. Thank you so much. – Michele Apr 08 '21 at 13:08

0 Answers0