Python virtualenv questions

Normally virtualenv creates environments in the current directory. Unless you’re intending to create virtual environments in C:\Windows\system32 for some reason, I would use a different directory for environments. You shouldn’t need to mess with paths: use the activate script (in <env>\Scripts) to ensure that the Python executable and path are environment-specific. Once you’ve done this, the command prompt changes to indicate the … Read more

Running Python from Atom

The script package does exactly what you’re looking for: https://atom.io/packages/script The package’s documentation also contains the key mappings, which you can easily customize.

How to customize a scatter matrix to see all titles?

As a minimal scatter_matrix example to switch off axis ticks and rotate the labels, #May need to offset label when rotating to prevent overlap of figure #Hide all ticks plt.show() and similarly, you can adjust labels, resize, etc with any of the axis objects contained in the returned handle from scatter_matrix. This results in,

Trouble updating to Anaconda Navigator 1.10.0 (MacOS)

I am having completely the same issue (same Navigator version on macOS). I think I have spent several hours of all possible solution and nothing helped. The only solution that worked was to uninstall and install again. The environment setup remains the same so there is nothing to lose (but still it is strange thought) … Read more

How to import other Python files?

importlib was added to Python 3 to programmatically import a module. The .py extension should be removed from moduleName. The function also defines a package argument for relative imports. In python 2.x: Just import file without the .py extension A folder can be marked as a package, by adding an empty __init__.py file You can use the __import__ function, which takes the module name (without … Read more

How to change default Python version?

[updated for 2021] (Regardless if you are on Mac, Linux, or Windows:) If you are confused about how to start the latest version of python, on most platforms it is the case that python3 leaves your python2 installation intact (due to the above compatibility reasons); thus you can start python3 with the python3 command. Historically… The naming convention is that generally, most … Read more