[PYTHON] Since I am free, I make "RPA tools" # 2 Development environment

Introduction

It's been a long time, everyone. My name is enp. I like tomatoes. This article is a progress report for anyone trying to make an "RPA tool". Please note that it does not describe how to make RPA or RPA tools. (Maybe I'll put a little sauce on it, it depends on my mood) This time, I would like to talk about the "development environment" of RPA tools, including "why it took a month to post". It's going to be a long time, but I would appreciate it if you could get along with me. I had a hard time talking to someone.

What is a development environment?

everyone.

Do you know the development environment?

Yes. __ Normally, if you hear such a thing, you will be beaten. That's the basic word. __ </ font> At least here is Qiita. I think many people can understand it without explaining it. However, I'm going to talk a little bit as you may be seeing someone on the road to programming today. Beginners. __ Maybe this article isn't helpful! I am like a beginner too. __

What is a development environment? Simply put, it's all the guys you need to do __development __. When it comes to software development, it's about programming languages and libraries. It also includes text editors, OS, and PC specifications. So what happens if the development environment is bad? This is just one example, but it can be difficult to develop or cause the developed app to be slow. So think carefully about your development environment.

My development environment

In the previous section, we talked about the development environment. In this section, I will talk about the development environment I built. I say I built it, but it's not a big deal.

RPA tool development environment

  • OS
    • Windows 10 --Programming language
    • Python --Library to use
    • openpyxl
    • selenium
    • ChromeDriver
    • kivy
  • Text editor
    • NeoVim

It is like this. I have omitted the CPU and memory. Also, there may be something that is not a library in the library column, but it was troublesome to classify. There may be more libraries in the future, but we will inform you at that time.

Don't you use Automagica in the first place?

In the previous section I talked about my development environment. This item derails a little. e? Isn't the derailment early? You may think, but please understand that I would like to talk a little.

You might think of "Automagica" when you hear that you use Python with RPA tools. Automagica is a free platform where you can create RPA with __Python. Selenium that I use is also included in Automagica. With Automagica you can get a GUI and create an RPA. You might even be able to create an RPA tool. e? Then you should use it. You think so, right? However, __ I didn't use it. __ The reason is __ to improve my own skills. With Automagica, it's easy to get your development environment ready. That's a good thing, but it's not my skill. So I didn't use it. In addition, I am thinking of choosing the difficult path as much as possible from now on, so thank you for your understanding.

Finally a detailed introduction to the development environment

In the previous section, we talked about the existence of Automagica. In this section, I will talk about why I finally chose the development environment.

ITEM.1 『OS:Windows 10』 The biggest reason is __ because I had __. Also, speaking of the OS in the company, I chose it from the prejudice like Windows. (It may be a Mac except for those who use Excel) However, in fact __ I was thinking of developing on Ubuntu at first __. The reason is that it was easy to use Ubuntu to use Linux commands on Windows. So why did you give up Ubuntu? __ I will talk about that later. __ </ font>

ITEM.2 "Programming Language: Python"

I chose __ because it was the easiest language to develop __RPA tools. I easily found a browser and a library that can operate xlsx files, so I decided to use it. Also, because it is a language that is widely used, I also wanted to touch it. There is a slight reason why __ because there was perfect Python in my house.

[Perfect Python](https://www.amazon.co.jp/%E3%83%91%E3%83%BC%E3%83%95%E3%82%A7%E3%82%AF%E3% 83% 88Python-PERFECT-5-Python% E3% 82% B5% E3% 83% 9D% E3% 83% BC% E3% 82% BF% E3% 83% BC% E3% 82% BA / dp / 477415539X)

ITEM.3 "Library to use: openpyxl, selenium, ChromeDriver"

These three are for operating the browser and operating the xlsx file. The reason I chose it is simple: __ Assorted sets of guys that came out first in the search results __. I've put it in for the time being, so if there is any inconvenience, I will add or change it at any time. (I feel that Chrome is slow at this point. Is there anything else good?)

ITEM.4 "Library to use: Kivy"

Kivy is a GUI library. The reason I chose it is __ because it is an open source library. After the development was finished, I chose the one that seems to have the least problem in terms of license. However, it is said that this guy is the cause of delaying the posting of articles for a month ... __ This story will come later! __ </ font>

ITEM.5 "Text Editor: NeoVim"

__because I like! __ CUI is good, isn't it? Well, there's also the reason I wanted to save the hassle of navigating from a __text editor to a command prompt or PowerShell. Compile and execute the program from the basic command prompt or PowerShell. That's why I wanted to use a text editor that runs at the command prompt or PowerShell as much as possible. I don't need to move VS Cord etc ... When this happens, it's a matter of taste.

This is the end of the introduction. It's a fierce shobo, but I'm going to think about various things and prepare the environment.

The biggest wall that stands up "Kivy"

Well, the introduction of the development environment is over. But don't forget.

"Because I am free, I make" RPA tool "# 1" was posted in May. More than a month ago.

Did you skip? Did you skip? It would be unavoidable to say so. But I want to say it out loud!

If you skip it, you'll have more free time!

Even though the corona wreck is spurring my spare time, skipping it is a complete fall. I have too much free time to ascend to heaven. So what have I been doing for a month? Actually, __ I just kept installing Kivy on Ubuntu __ </ font>. The reason is simple. __Kivy didn't seem to move, so __ </ font>. The reason why it doesn't work is simple. When executed, it throws the following error.

egl_rpi - ImportError: cannot import name bcm

__ Well, if you can't read the necessary files, it won't work. __ </ font> There were other error statements, but if you can't import the required files, they won't work forever. So, first I tried to find out if anyone was in a similar situation. Then, you will come to the following site.

"ImportError: cannot import name bcm" error with running basic kivy app in ubuntu 15.04

The error content is almost the same. So, I tried my best to try everything written here. I checked SDL2 related, checked the versions of cython and kivy, and installed it as officially. I tried various other things, but __ annihilated. __ </ font> It's all a failure without any sign of improvement. In the process, there was an incident where the Vim I was using broke and moved to NeoVim. I tried to move to another GUI library, but __ This was also wiped out. __ </ font> I felt like I was watching the error electrical parade. The electrical parade of errors is nothing more than a fan. Apparently, the god of the GUI library has forsaken me. When I tried to close my PC with sadness, I suddenly noticed.

Kivy is open source

That's right. I completely forgot the biggest advantage. __Kivy can browse everything from directory structure to program source. __ </ font> So I decided to compare Kivy on my PC with Kivy, which is open source. __ And finally there was progress. I noticed that bcm.pyx and egl.pyx do not exist in __kivy / lib / vidcore_lite __.

Well, if you don't refer to it, you'll get an error. </ Font>

So, bring the missing source from GitHub and copy it. Execute the sample code triumphantly.

egl_rpi - ImportError: cannot import name bcm

I hate it! !! !!

I added it! I added the correct source in the right place! The god of the GUI library wasn't that sweet. Apparently, it seems that it is compiling at the same time when installing it on Ubuntu, and it seems that it will not be executed just by adding it later. Of course, when I look at the kivy whl file on my PC with the unzip command, there are no bcm.pyx and egl.pyx inside. __what the hell! __ This is what it means to run out of measures. I completely lost sight of the solution. There is only one way to do this.

__ Yes. This is another power application. __ </ font>

You can't do it without relying on the power of others. I'm exhausted and mummy. So I talked to my friends about what happened so far and asked for help. And a friend said.

Friend "Is Windows useless?"

I "What? Genius?"

At that time, I had no idea of changing the OS. However, there are some things I think about. __ Does it really work just by changing the OS? __ With a little doubt, install Kivy on Windows and run the sample code. Kivy's GUI

It worked! !! !!

At that moment, I __ I erased Ubuntu in a flowing __ </ font>.

That's what happened in the last month. Well, I'm happy to talk to you __. I didn't expect to stumble so much in the work of preparing the development environment. By the way, __Why did bcm.pyx and egl.pyx disappear? __ It's not beyond my imagination, but when I was fighting Kivy, I felt the following three things.

--I am the cause --During the installation of Kivy, I made a mistake and it disappeared. --Caused by the development side --Only Kivy on Linux does not include bcm.pyx and egl.pyx in the installation file. --Caused by Ubuntu ――Ubuntu was flipping without permission.

It worked normally on Windows, so the above may be the cause. The most prominent is "I am the cause". But that's all I can say clearly. __ If something similar happens, give up and change your OS. That is faster. __

Finally

Thank you for staying with us until the end. How far have you read Kivy's story? I hope you read it all. I really had a hard time. However, __ I'm still at the starting line. I haven't even developed it. __ </ font> The game is about to come. I have to do my best. I think the next article will be something like "Becoming friends with the library Part.1", so thank you. That's all for enp.