Academia Potter and the Mysterious Python Pass

Preface

Last year, when I wrote Black Lab Era with my heart, I accidentally buzzed and ** the best myself. The article that won the Ne is now called Fucking Poem ** [^ 1].

I entered this year without any sexual discipline, so I will write about the hardships at that time. (As expected, this doesn't buzz ...?)

[^ 1]: I can't show this account even if I want to change jobs, but I have no intention of changing jobs for a while ...

Dirty PYTHONPATH

As I wrote in the last article

Underneath, I managed to write my own beliefs as a programmer while writing the code silently, but even so, there was a senior who got along with me one step higher. The senior had the same engineer temperament as himself in the conservative laboratory, but on the contrary, he was too devoted to the information system rather than the theoretical research, so he was treated as a heretic in the laboratory. I asked other doctoral seniors [^ 2] for guidance on theory, and I also received SNS from those seniors for programming [^ 3].

[^ 2]: This person is a solid physicist and not very familiar with programming.

[^ 3]: Regarding whether it was face-to-face, there was a case that the person did not come to the laboratory more than himself, but there was also a situation that he was doing research with a considerable amount of off-time. At that time, I had the idea that "if you go to D, you can type in without distinguishing between public and private", and moreover, if you have an internet in the supercomputer, you could connect with SSH, so even at home around 3 o'clock midnight It was natural to play with the code in the laboratory. For that reason, there were many cases where "I tweeted that there was something stuck, and the senior told me." Now, if you think calmly, such a style of ** "pushing in off time" cannot be sustainable enough to be a profession **.

So far, I was in a situation where "I or my seniors use Python", but I was using Python2 instead of Python3. The reason was that major libraries such as matplotlib didn't work for some reason. In addition, some software such as git did not work well. I'm not sure, but I had no problem with Python2, so I wrote post-process code in Python2.

One day I had the opportunity to look at environment variables. Then, the PATH was in a place I didn't understand. If you look closely, it was a shared directory that senior engineers usually use. Probably, I can't take root of the supercomputer system, so I think I installed it with the --user flag set. I think PYTHONPATH probably contained that path as well.

It was pretty messy, and I didn't have that much knowledge at the time, so I ended up completing it without taking any action.

approach

I can't write about git in a word, but ** Python library can be avoided by using venv **.

With venv, you can separate the virtual environment from the original environment, and you can put the libraries in without using the directories that root needs. Moreover, it does not affect other users.

By the way, about venv, I have compiled it myself the other day, so I would like you to refer to it (Daima). https://qiita.com/bluepost59/items/c13c88a9387e28189d7b

Postscript

venv seems to be old.

https://qiita.com/sk217/items/43c994640f4843a18dbe

Summary

This article has no intention of blaming senior engineers. My seniors were also students at the time, and I understand the desire to introduce new things.

After all, it has become more than half poem this year, but I hope it helps someone.

Recommended Posts

Academia Potter and the Mysterious Python Pass
The story of Python and the story of NaN
How to pass and study the Python 3 Engineer Certification Basic Exam
Pass the path of the imported python module
Python open and io.open are the same
Summary of the differences between PHP and Python
The answer of "1/2" is different between python2 and 3
[Xonsh] The Python shell is sharp and god
ffmpeg-Build a python environment and split the video
Specifying the range of ruby and python arrays
About the difference between "==" and "is" in python
Compare the speed of Python append and map
Solving the Lorenz 96 model with Julia and Python
Archive and compress the entire directory with python
About the * (asterisk) argument of python (and itertools.starmap)
A discussion of the strengths and weaknesses of Python
Pass an array from PHP to PYTHON and do numpy processing to get the result
Receive the form in Python and do various things
The story of Python without increment and decrement operators.
[Python] Measures and displays the time required for processing
The process of installing Atom and getting Python running
Pass the authentication proxy through communication using python urllib3
Python --Explanation and usage summary of the top 24 packages
Carefully understand the exponential distribution and draw in Python
Visualize the range of interpolation and extrapolation with python
Plot and understand the multivariate normal distribution in Python
Referencing and changing the upper bound of Python recursion
I checked out the versions of Blender and Python
Send and receive Gmail via the Gmail API using Python
Carefully understand the Poisson distribution and draw in Python
Find the Hermitian matrix and its eigenvalues in Python
PHP and Python samples that hit the ChatWork API
The VIF calculated by Python and the VIF calculated by Excel are different .. ??
Rotate and scale the image before cropping [python] [OpenCV]
Install django on python + anaconda and start the server
[Python] Start a batch file from Python and pass variables.
[python] Compress and decompress
Find the maximum Python
[C / C ++] Pass the value calculated in C / C ++ to a python function to execute the process, and use that value in C / C ++.
Batch design and python
Python iterators and generators
Python packages and modules
Vue-Cli and Python integration
Ruby, Python and map
the zen of Python
python input and output
[Python] Split the date
Python3, venv and Ansible
Python asyncio and ContextVar
Let's review the language specifications around Python iterators and generators
[Python] Heron's formula functionalization and calculation of the maximum area
Remove double-byte spaces before and after the character string (python)
[Python] Read the csv file and display the figure with matplotlib
Get the MIME type in Python and determine the file format
Sort and output the elements in the list as elements and multiples in Python.
[python] plot the values ​​before and after the conversion of yeojohnson conversion
[2020 version] Let Python do all the tax and take-home calculations
Solve the spiral book (algorithm and data structure) with python!
Manipulate the clipboard in Python and paste the table into Excel
[Python] I installed the game from pip and played it
Build a Python environment and transfer data to the server