To fix a python error such as “ModuleNotFoundError: No module named ‘tweepy’”, you should check your version of python with: python3 –version Often you will have one version installed but trying to execute the script with another version where the module is not installed. Check your python version in your path with: echo $PATH For… Read More »
To solve the error below: from mysql.connector import Error ImportError: cannot import name ‘Error’ from ‘mysql.connector’ (unknown location) I needed to install mysql_connector via: pip3 install mysql_connector I had already installed mysql via: pip3 install mysql-connector-python But python needs both.
If you have changed your database schema, you can up date your model by first running the inspectdb command. python manage.py inspectdb > models.py If you have too many tables in your database, pipe the results to a temporary file first and then manually copy the models over. python manage.py inspectdb > models_temp.py Then run:… Read More »
Secure Copy scp [file on your computer] [destination host]:[folder] eg: scp main.py email@example.com:website.com/folder PIP pip3 install requests pip3 install beautifulsoup4 pip3 install mysql-connector-python JSON viewer https://jsonlint.com/ One way to traverse YouTube is [header][c4TabbedHeaderRenderer][subscriberCountText][accessibility][accessibilityData][label] However, an easier way is to use a helper site.
Dreamhost has a great resource for installing Python which can be found at: https://help.dreamhost.com/hc/en-us/sections/203651898-Python In particular, if you are using Python 3, this is the resource guide to use: https://help.dreamhost.com/hc/en-us/articles/115000702772-Installing-a-custom-version-of-Python-3
Just add: PROMPT=’%~$ ‘ to your .zshrc file and you should have the entire directory path displayed in terminal. %~ means show the path relative to HOME.
Get git autocompletion in 2 mins. Run the following commands: Step 1 curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash -o ~/.git-completion.bash Step 2 Add the following to your ~/.bash_profile file: if [ -f ~/.git-completion.bash ]; then . ~/.git-completion.bash fi Step 3 Apply the changes: source ~/.bash_profile If you don’t have permission, run: chmod +x ~/.git-completion.bash Step 4 Test
–help is your friend after git + <your_command> Step 1: Check your branch git branch Step 1a: If you need to create a branch git branch dev Step 1b: If you need to delete a branch git branch -d dev Others to keep in mind git branch -D dev git branch -m dev2 git branch… Read More »
Is it me or is this map of the world just simple and elegant?
Just type: brew analytics Analytics are enabled. and if brew analytics is enabled, it will say so. To turn it off, type: brew analytics off (this will prevent analytics from ever being sent) The other option is to set an environment variable: export HOMEBREW_NO_ANALYTICS=1 If you are interested to see what info is being sent,… Read More »