Skip to main content

Posts

Showing posts with the label Python

Sharing a virtualenv across several Python projects using Pipenv

There is a standard library for all projects in Python. However, several projects don’t always have the same dependencies all the time. That is where virtual environments come to play.

You can follow this official document to use two separated tools virtualenv and pip to fulfill that need. My preferred alternative is to use pipenv. Pipenv is easy to use and convenient. The following are my steps to make a shared virtualenv for my all projects which requires the same dependencies.

Step 1. Create an isolated virtualenv.
python -m venv my-shared-env Step 2. Create a symbolic link to the created virtualenv.
cd project_1 ln -s ~/.local/share/virtualenvs/my-shared-env .venv I have encountered the following issue at step 1.
FileNotFoundError: [Errno 2] No such file or directory: '{my_project_path}/.venv/bin/pip': '{my_project_path}/.venv/bin/pip' The root cause was I tried to create virtualenv by running pipenv install and renaming the generated virtualenv to a new name but …

"Java & Agile" was renamed "Python & Machine Learning"

I have started blogging since 2014. In fact, I just happened to know a very nice free blogging course of John Sonmez. Time flies!

I currently work at a startup to build an AI chatbot. It was where Python and Machine Learning become my most focus from now on. That also was a reason why I wanted to rename my blog theme. I still keep using Java in my projects though.

Thank you all for reading my blog so far. It motivates a lot to keep me carrying on this habit.

TL;DR
A new topic "Python & Machine Learning" is added to my blog theme today. Yay!