Python3 advanced installation

Hi guys, I’m having trouble installing the advanced section of Python

i cant seem to execute open ‘~/.bash_profile’ on my terminal as it says ‘permission denied’ tried using sudo but nothing works. any idea how to resolve this?

Hi there,

This error message is just informing you that you must use the python3 command when running scripts. If you want to use python command instead then edit ~/.bash_profile. If you are getting a permission denied try running the following command:

chmod 600 ~/.bash_profile

However, you shouldn’t have to do this. Just type, python3 and the script name to run the program. Judging from the message, Python is installed on your machine, you just have to use the correct command.

Let me know if this resolves our issue!

hi, i tried again but this time the error message is invalid syntax
Screenshot 2022-11-07 at 11.53.02 AM
i opened my terminal and typed python3 to enter the program and there was no permission denied but could not execute the following command afterward ~/.bash_profile

did i type it wrongly?

Hi,

Yes, the .bash_profile is used for customizing the user configuration settings. It is not a Python file!
You must enter python3 to execute a script. If you wanted to change how you entered commands (type python), then you would edit this file! However, you should not have to do this!

Check Python Version

Run this command, you should see a python version installed on your machine

python3 --version

Let me know what you see when you run this command.

How to run Python scripts

If the above command works, then Python is installed on your machine. To run a Python script type: python3 filename.py
For example, if your file is named, “my_file.py”, then type:

python3 my_file.py

Let me know if this resolves your issue!

Hi, initially i had issues installing pipenv as requested on my course. I followed the steps till the end but could not see pipenv --version. So i figured maybe its because i didn’t install the advanced section of python. The python version installed on my machine is python 3.11.0

Screenshot 2022-11-07 at 7.39.53 PM

I was expecting this after following the steps. But instead its command not found: pipenv
Sorry for the trouble, I’m new to this :sweat_smile: