Unable to get a Window, abort for kivy - python-3.x

This is the error:
[1]: https://i.stack.imgur.com/t7SCc.png
I have already seen and followed all answers in this site. But I am facing same problem😥😥

It is highly recommended to use virtual environment for kivy
Setup terminal and pip
python -m pip install --upgrade pip setuptools virtualenv
Create a virtual environment inside the root directory of your project
python -m virtualenv kivy_venv
kivy_venv\Scripts\activate
source kivy_venv/Scripts/activate
After creating virtual env then install kivy on virtual env
For more details - https://kivy.org/doc/stable/gettingstarted/installation.html#install-pip

Related

Pip gets removed from virtual env after install a package

I have created a virtual environment:
Python -m venv test
I then checked that pip was indeed in the environment. this is the content of the scripts folder:
activate deactivate.bat pip.exe* python.exe*
activate.bat easy_install.exe* pip3.9.exe* pythonw.exe*
Activate.ps1 easy_install-3.9.exe* pip3.exe*
I then ran which pip to confirm that it would be the env pip, which it was.
I wanted to install django:
pip install django
After i installed it, i ran which pip again, but this time it was pointing to system pip. The scripts folder in my environment no longer had the pip files.
How do i keep things separate?

Setting Up a Python Virtual Environment with Hydrogen in Atom

I'm in the middle of switching from VS Code to Atom and I'm trying to set up a virtual environment for my python project.
It was pretty easy to do in VS Code, I'd run the following script and it would automagically start using the new env (with all the required packages) when I'd run the script:
python3 -m venv my_env
source my_env/bin/activate
pip3 install -r requirements.txt
Now I'm trying to set up Hydrogen to work the same way. When I run lines of code inline with Hydrogen, I want them to be run in a virtual environment that has the imported modules I need from a requirements.txt file.
I was able to install the python3 kernel with the following commands:
python3 -m venv my_environment_name # create a virtual environment
source my_environment_name/bin/activate # activate the virtual environment
python -m pip install ipykernel # install the python kernel (ipykernel) into the virtual environment
python -m ipykernel install
And Atom is able to see it:
Screenshot
However, I'm still puzzled as how to install my dependencies into the kernel. And if I do install my dependencies there, I don't want my next python projects to have all those modules in there. I'd love to have the fresh-slate that virtual environments promise.
Any help here would be appreciated. Has anyone had experience setting up a virtual environment that can be used by the Hydrogen package?
Ok, after some more experimentation, I was able to connect to a kernel that I had installed my requirements.txt into.
Here are the steps I took:
python3 -m venv env
source env/bin/activate
# make sure requirements.txt has ipykernel in it
pip3 install -r requirements.txt
python3 -m ipykernel install --user --name=env
Then in Atom, press cmd-shift-p and find Hydrogen: Update Kernels.
Or manually Packages->Hydrogen->Update Kernels
After, I was able to use the kernel by doing cmd-shift-p again and selecting Hydrogen: Start Local Kernel and selecting env.
When I would run import statements via Hydrogen (selecting them and pressing cmd-enter), they would now know what to import! Horray!
Windows Version.
This is the windows version of the excellent answer by Tim Estes. Without the use of requirements.txt in case some folks such as myself would like to install ipykernel separately. (Thanks so much Tim, it saved me a ton of time)
python -m venv env
env/bin/activate
pip install ipykernel
python -m ipykernel install --user --name=env
Similar to Tim's answer, go ahead and update kernels at Atom.
Packages->Hydrogen->Update Kernels

Creating a virtualenv using Python 3 error

I have python in ConEMu loaded and am trying to creating a virtual environment to work in.
I used
pip3 install virtualenv --user
and it said that virtualenv was usccessfully installed, however then I try to
virtualenv .venv
and i get the error message
bash: virtualenv: command not found
wondering if anyone else has run into this problem
virtualenv is built into python 3, and called venv. You don't need to install anything with pip.
You can make a virtualenv in python 3 like this:
python3 -m venv ve

Error: Creating Virtual Environment (with virtualenv) while setting up python Selenium via Terminal

I'm stuck trying to create a virtual environment. The instructions for this step are:
Create a new VirtualEnv in the directory for your Selenium files:
virtualenv -p /usr/bin/python3.0 venv
After checking my version of python I get: "Python 3.6.0 :: Anaconda 4.3.1 (x86_64)".
I tried replacing '3.0' with '3.6':
Wills-MacBook-Pro-2:my_selenium_project willdudek$ virtualenv -p /usr/bin/python3.6 venv
and get this error message:
The path /usr/bin/python3.6 (from --python=/usr/bin/python3.6) does
not exist
I also tried quitting terminal and reopening (so I'm not in my_selenium_project), importing virtualenv in Python, then trying to create a virtual environment using virtualenv my_selenium_project and that didn't work.
Do I need a different command since I'm running Python through Anaconda?

How to install a python module in ONLY virtualenv?

I am able to install python module in virtualenv but it is accessible outside the virtualenv as well. How to restrict its usage in virtualenv?
I went to the virtualenv path and then typed activate. It got activated as I could see root at the beginning.
And then I used the command pip install module_name
Activated the virutal env and then deactivated it.
When I activated the virtual env I was able to import the module.
When I deactivated it still the module was easily imported.
I assume the module was installed globally. I want it to be installed only in virtual env and should not be accessible outside.
The virtualenv tool is basically used to isolate the dependencies required for multiple projects. The python version installed within virtualenv won't be visible in the global directory.Try following the below steps properly in the virtualenv.
pip install virtualenv
cd my_project_folder
virtualenv venv
virtualenv -p /usr/bin/python3.5 venv
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python2.7
source venv/bin/activate
[Vitualenv Link:][1]
http://docs.python-guide.org/en/latest/dev/virtualenvs/
virtualenv -p /usr/bin/python3 name_of_venv #to create venv
source name_of_venv/bin/activate #to activate venv
pip install module_name #to install module
It is not visible from the outside. As soon as you type deactivate it is no longer importable.

Resources