Unable to install boto3

Don’t use sudo in a virtual environment because it ignores the environment’s variables and therefore sudo pip refers to your global pip installation. So with your environment activated, rerun pip install boto3 but without sudo.

Anaconda “failed to create process”

I encountered the exact same error, because my username included a space. (“C:\Users\Ben Ji”) The easiest solution is to install Anaconda to another folder in the Users-folder, e.g. public. (The same error occurs when using pip, check out https://stackoverflow.com/a/35275384/6580199)

How do you switch between python 2 and 3, and vice versa?

Using ‘virtualenv’ you can have different isolated Python environments on a single machine. Also you can switch any-time between the different python interpreter versions. What is virtualenv? A Virtual Environment is an isolated working copy of Python which allows you to work on a specific project without worry of affecting other projects. It enables multiple side-by-side installations … Read more

Error loading MySQLdb module: No module named ‘MySQLdb’

MySQLdb is only for Python 2.x. You can’t install in Python 3.x versions. Now from your question i can see that you are working with Django. In this case you have three alternatives, from Django mysql notes: mysqldb mysqlclient mysql-connect-python This gives to you two alternatives, mysqlclient and mysql-connect-python, The first one requires compilation from extensions … Read more

Invalid syntax when using “print”?

That is because in Python 3, they have replaced the print statement with the print function. The syntax is now more or less the same as before, but it requires parens: From the “what’s new in python 3” docs:

Converting a list to a set changes element order

A set is an unordered data structure, so it does not preserve the insertion order. This depends on your requirements. If you have an normal list, and want to remove some set of elements while preserving the order of the list, you can do this with a list comprehension:>>> a = [1, 2, 20, 6, 210] >>> … Read more

How to install numpy to Python 3.5?

Although using virtual environment is advisable in many use-cases, it is not strictly required. You can have a system python3.5 and a pip installation associated with it. Note that Python 3.5 is now end-of-life and pip has now dropped support. The final version of pip supporting Python 3.5 was 20.3.4 (Jan 2021). Download this file: pip-20.3.4-py2.py3-none-any.whl Bootstrap a pip installation using the wheel … Read more