ERROR: virtualenvwrapper could not find virtualenv in your path

Re-installling virtualenv fixed my problem. I had the same issue. $ mkvirtualenv mysite ERROR: virtualenvwrapper could not find virtualenv in your path After a lot of time consuming efforts, I decided to re-install virtualenv. sudo apt install virtualenv This fixed my issues. I already had virtualenv installed. But I think it got broken or met … Read more

python – os.getenv and os.environ don’t see environment variables of my bash shell

Aha! the solution is simple! I was setting variables with plain $ A=5 command; when you use $ export B=”foo” everything is fine. That is because export makes the variable available to sub-processes: it creates a variable in the shell and exports it into the environment of the shell the environment is passed to sub-processes … Read more

How does python find a module file if the import statement only contains the filename?

http://docs.python.org/3/tutorial/modules.html#the-module-search-path 6.1.2. The Module Search Path When a module named spam is imported, the interpreter first searches for a built-in module with that name. If not found, it then searches for a file named spam.py in a list of directories given by the variable sys.path. sys.path is initialized from these locations: The directory containing the … Read more

Add to python path mac os x

Modifications to sys.path only apply for the life of that Python interpreter. If you want to do it permanently you need to modify the PYTHONPATH environment variable: PYTHONPATH=”/Me/Documents/mydir:$PYTHONPATH” export PYTHONPATH Note that PATH is the system path for executables, which is completely separate. **You can write the above in ~/.bash_profile and the source it using … Read more

PYTHONPATH on Linux [closed]

PYTHONPATH is an environment variable which you can set to add additional directories where python will look for modules and packages. e.g.: # make python look in the foo subdirectory of your home directory for # modules and packages export PYTHONPATH=${PYTHONPATH}:${HOME}/foo Here I use the sh syntax. For other shells (e.g. csh,tcsh), the syntax would … Read more

How to get the PYTHONPATH in shell?

The environment variable PYTHONPATH is actually only added to the list of locations Python searches for modules. You can print out the full list in the terminal like this: python -c “import sys; print(sys.path)” Or if want the output in the UNIX directory list style (separated by 🙂 you can do this: python -c “import … Read more

Where to put a configuration file in Python?

Have you seen how configuration files work? Read up on “rc” files, as they’re sometimes called. “bashrc”, “vimrc”, etc. There’s usually a multi-step search for the configuration file. Local directory. ./myproject.conf. User’s home directory (~user/myproject.conf) A standard system-wide directory (/etc/myproject/myproject.conf) A place named by an environment variable (MYPROJECT_CONF) The Python installation would be the last … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)