Because I created a virtual environment to isolate all the things that needs to be installed like kivy, and I installed cython and kivy first before the homebrew, it caused the problem. Even if I use:
What I did to solve it are the following:1. Created a new virtual environment2. Followed the instruction in kivy in right order: (1) homebrew, (2) Cython, then (3) Kivy.3. Used "python" command instead of "kivy" command because I installed it using pip (refer to the commenr above). For example:
(There is still part of the error I could not show since I hit the character limit and I do not know what is the important part of it so I deleted everything does not contain ERROR but there are some parts contain WARNING)I have searched for ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output. and found some answers which didn't work for me (or I just did not understand since I am relatively new to python).
I have been trying to simulate a command line design which would allow me to:
- Type in a command
- Execute it
- Output it in the same window below the command text that I have typed in.
So what I need is this:
I have partially completed this but what happens is that the output text overwrites the input instead of 'adding up'. Another problem that I have encountered is that I have to click on the TextInput window every time I need to type something in instead of just being able to keep typing in the commands without ever using my mouse.
Note that when you need several dots to retrieve some object, e.g. self.ids.fetch_key_and_process_command don't keep doing that over and over again--it's inefficient. Instead, retrieve the object once and assign the object to a variable, then use the variable from then on, with the added benefit that it's easier to type!
Another problem that I have encountered is that I have to click on the TextInput window every time I need to type something in instead of just being able to keep typing in the commands without ever using my mouse
Create a button that the user can click when they are done typing--just like the Post Your Question button that you clicked when you were done typing your question here. Then the button can call process_command() instead of the TextInput:
1) The problem with adding text to the TextInput is that when you retrieve the text for the second command, you will get all the text in the TextInput, which will contain the text of the first command as well as the output for the first command, right? So that long string containing the first command and the output of the first command and the second command is not going to be a key in your command_dict, right? So, you are going to have to somehow process all that text and extract the second command.
You can certainly do that, say splitting the text on newlines, but it would be easier to have one TextInput for the input and another TextInput or Label for the output, then you can clear the input TextInput after every command.
I coded an app in Python and kivy and it works well in PyCharm and I tried to convert it into an actual Mac app through Xcode 10.1. When I build and run the code to get the simulation, the building fails and I get this error. I assume that the TypeError is the issue. Inside my code, I have SQL queries, so I've removed the comma and added '%' instead. When a tuple is called to fill in the variables, it doesn't work. Maybe it is not the error after all?! Any ideas?
In this code, you import Image from the kivy.uix.image sub-package. The Image class takes a lot of different parameters, but the one that you want to use is source. This tells Kivy which image to load. Here, you pass a fully-qualified path to the image. The rest of the code is the same as what you saw in the previous example.
Here, you import BoxLayout from kivy.uix.boxlayout and instantiate it. Then you create a list of colors, which are themselves lists of Red-Blue-Green (RGB) colors. Finally, you loop over a range of 5, creating a button btn for each iteration. To make things a bit more fun, you set the background_color of the button to a random color. You then add the button to your layout with layout.add_widget(btn).
Now in this article, we will discuss how to build a window in kivy, just like a login screen which is able to take the user name and password from the user without the functionality just the layout of this.
You could use a command line, but I kept running into a memory error issue maybe due to it being a large file (121 MB) and my firewall and anti-virus program so I just went to the PyPI site to download the wheel. I downloaded the appropriate version for my Python 2.7, 32-bit. ( kivy.deps.gstreamer-0.1.12-cp27-cp27m-win32.whl). Once the file is downloaded to our usual location, run pip install:
Before using a third-party library like Kivy, we must install it in our working environment. Installing Kivy is as quick as running the python -m pip install kivy command on your terminal or command line. This command will install the library from the Python package index (PyPI).
This command will create a folder called kivy_env containing a Python virtual environment. The Python version in this environment is the same as you get when you run python --version on your command line.
In the final line, we create an instance of MainApp and call its run() method. This method launches the application and runs its main loop. That's it! We're ready to run our first Kivy app. Open your command line and run the following command:
To deeply customize a GUI or design a 2D video game, we may need to draw 2D shapes, such as a rectangle, circle, ellipse, or triangle. Doing this is straightforward in Kivy. The library provides a rich set of shape classes that you can find in the kivy.graphics package. Some of these classes include:
Finally, we return the root widget as expected. The final line of code creates the app instance and calls its run() method. If you run this app from your command line, then you'll get the following window on the screen:
When your Kivy project grows, your .kv file will grow as well. So, it is recommended that you split up the file into different files for readability. In such cases, you will end up with multiple .kv files, and the automatic loading mechanism will not be sufficient. You'll have to use the Builder class from kivy.lang.Builder.
The Kivy recipe depends on several others, like the sdl* and python recipes.These may, in turn, depend on others e.g. sdl2_ttf depends on freetype, etc.You can think of it as follows: the kivy recipe will compile everythingnecessary for a minimal working version of Kivy.
Conda is a dependency manager and makes it extremely easy to work with different versions of Python and its dependencies too. To be honest, at first I didn't like using it and did not find it very useful when I can manage everything using pip commands inside a docker container. Docker and Conda are of course completely 2 different things, but they both try to solve similar problems.
Docker is more general but still works quite good with Python dependency management especially when you're working with console or web applications. But, Conda is more specialised on managing Python and may be inevitable if you're working with graphical interfaces. So, with kivy library it's better to use Conda.
Note that toolchain.py file is inside this kivy-os folder. So, when you need to run it you may need to use either absolute or relative path unless you're already inside the folder. Also library pbxproj could not be found in any of the conda channels. So that's why I used pip. It's not good to mix pip and conda but if inevitable you can go for it. Last step when we build recipes may take a while.
The command above creates a buildozer .spec file, which you can use to make specifications to your app, including the name of the app, the icon, etc. The .spec file should look like the code block below:
Add the kivy repo, install kivy, run the app, that works. Let's try to package! Oh, there's none. Guess you'll just have to use a shell script or something to install the things then run. Oh well....but you'll need it for Android!
Then you can run buildozer android debug deploy run as the Kivy docs suggest, but I found that this was hanging. I searched, searched and searched, and found someone suggesting we use a -v flag so that we can see the error output. So the command instead is:
To be able to read this file, you need to know domain and name of your application. By default those are accordingly org.test and myapp (changable in buildozer.spec file created by buildozer init command), what gives you full package name of org.test.myapp.
When you deploy your application to your smart phone and it crash, or you simply want to see an output, do not disconnect your phone. Run terminal and execute below commands to run shell, change directory to your application directory, and list files:
We also provide nightly wheels generated using Kivymaster. See Nightly wheel installation.If installing kivy to an alternatelocation and not to site-packages, please see Installing Kivy and editing it in place.
Now that python is installed, open the Command line and make surepython is available by typing python --version. Then, do the following tocreate a new virtual environment(optionally) and install the most recent stablekivy release (1.11.1) and its dependencies.
Know your command line. To execute any of the pipor wheel commands, one needs a command line tool with python on the path.The default command line on Windows isCommand Prompt, and thequickest way to open it is to press Win+R on your keyboard, type cmdin the window that opens, and then press enter.
Walking the path! To add your python to the path, simply open your command lineand then use the cd command to change the current directory to where pythonis installed, e.g. cd C:\Python37. Alternatively if you only have onepython version installed, permanently add the python directory to the path forcmd orbash.
760c119bf3