How to install multiple python packages at once using pip

For installing multiple packages on the command line, just pass them as a space-delimited list, e.g.: For installing from a text file, then, from pip install –help: -r FILENAME, –requirement=FILENAME Install all the packages listed in the given requirements file. This option can be used multiple times. Take a look at the pip documentation regarding requirements files for … Read more

Using Pip to install packages to Anaconda Environment

For others who run into this situation, I found this to be the most straightforward solution: Run conda create -n venv_name and conda activate venv_name, where venv_name is the name of your virtual environment. Run conda install pip. This will install pip to your venv directory. Find your anaconda directory, and find the actual venv folder. It should be somewhere like /anaconda/envs/venv_name/. … Read more

os.path.dirname(__file__) returns empty

Because os.path.abspath = os.path.dirname + os.path.basename does not hold. we rather have Both dirname() and basename() only split the passed filename into components without taking into account the current directory. If you want to also consider the current directory, you have to do so explicitly. To get the dirname of the absolute path, use