Python will not work for any program!

Hey guys, thanks for reading my post. I am new to python. It was working on Kali for me just fine for months, then all of a sudden it messed up on a colossal basis; it no longer works for anything. It doesn’t recognize I am in an external environment. I pasted my lovely experience below. any help is extremely appreciated. Thank you, everyone!


┌──(chris㉿kali)-[~/fun/soup/Python]
└─$ pip3 install flood.py               
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.
    
    If you wish to install a non-Kali-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have pypy3-venv installed.
    
    If you wish to install a non-Kali-packaged Python application,
    it may be easiest to use pipx install xyz, which will manage a
    virtual environment for you. Make sure you have pipx installed.
    
    For more information, refer to the following:
    * https://www.kali.org/docs/general-use/python3-external-packages/
    * /usr/share/doc/python3.13/README.venv

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
                                                                                                         
┌──(chris㉿kali)-[~/fun/soup/Python]
└─$ source /home/chris/myenv/bin/activate
                                                                                                         
┌──(myenv)─(chris㉿kali)-[~/fun/soup/Python]
└─$ pip3 install flood.py
ERROR: Could not find a version that satisfies the requirement flood.py (from versions: none)
ERROR: No matching distribution found for flood.py                                                       
                                                                                                         
┌──(myenv)─(chris㉿kali)-[~/fun/soup/Python]
└─$ pip install -r soup.py          
ERROR: Could not open requirements file: [Errno 2] No such file or directory: 'soup.py'
                                                                                                                                                                        
                                                                                                         
┌──(myenv)─(chris㉿kali)-[~/fun/soup/Python]
└─$ pipx install flood.py --include-deps
Fatal error from pip prevented installation. Full pip output in file:
    /home/chris/.local/state/pipx/log/cmd_2025-12-02_16.52.53_pip_errors.log

Some possibly relevant errors from pip install:
    ERROR: Could not find a version that satisfies the requirement flood-py (from versions: none)
    ERROR: No matching distribution found for flood-py

Error installing flood-py.
                                                                                                         
┌──(myenv)─(chris㉿kali)-[~/fun/soup/Python]
└─$ deactivate
                                                                                                         
┌──(chris㉿kali)-[~/fun/soup/Python]
└─$ pipx install flood.py --include-deps
Fatal error from pip prevented installation. Full pip output in file:
    /home/chris/.local/state/pipx/log/cmd_2025-12-02_16.53.05_pip_errors.log

Some possibly relevant errors from pip install:
    ERROR: Could not find a version that satisfies the requirement flood-py (from versions: none)
    ERROR: No matching distribution found for flood-py

Error installing flood-py.
                                                   

It seems like you are trying to install a package.

Exactly which package is it that you’re trying to install? Can you locate it on pypi.org?

Not Kali user but IMHO there is link provided in error message which leads to the page with explanation why this is expected behaviour.

Thanks for your expedient reply! I just deleted two PATHs or my .cache I had gotten a permissions errors on in my /home/username directory last night and pipx worked on a package (pipdeptree) listed over on PYPI. However, this was just an example as you asked about a package. Initially, I was compiling a Python program from github. Under .py files, I continue to be told to enter a virtual environment when I am already in one. As you can imagine, it has me super frustrated as well as scratching my head.

can you use which python to confirm you are in a venv, and use pipx to install something to confirm that still works?

Hey, I checked that out previously and just tried it again to see if I had any luck. I tried sudo apt install on requirements.txt and it didn’t work.

┌──(chris㉿kali)-[~/fun/wifi-network-scanner]
└─$ sudo apt install requirements.txt
Error: Unable to locate package requirements.txt
Error: Couldn’t find any package by glob ‘requirements.txt’

However, when I look at the file and do sudo apt install [package] it works just fine. I’m confused as to why it isn’t doing that through the entire requirements.txt file either.

┌──(myenv)─(chris㉿kali)-[~/fun/wifi-network-scanner]
└─$ which python
/home/chris/.pyenv/shims/python

Also, outside (myenv) I get what seems like me in venv still!

┌──(chris㉿kali)-[~/fun/fade]
└─$ which python
/home/chris/.pyenv/shims/python

Pipx gives me the same error message over and over:

┌──(myenv)─(chris㉿kali)-[~/fun/fade]
└─$ pipx install setup.py --include-deps
Fatal error from pip prevented installation. Full pip output in file:
/home/chris/.local/state/pipx/log/cmd_2025-12-03_09.49.36_pip_errors.log

Some possibly relevant errors from pip install:
ERROR: Could not find a version that satisfies the requirement setup-py (from versions: none)
ERROR: No matching distribution found for setup-py

Error installing setup-py.

That does seem like something that could cause this error. If your computer thinks your “system” python is your venv python, system_python==current_python is true, and it would raise this error instead of letting you install your package (?)

You mentioned you deleted some PATH entries. You might need to add the main python back in with a sufficiently high priority (?)

You mentioned you deleted some PATH entries. You might need to add the main python back in with a sufficiently high priority (?)

How would I go about doing this? Sorry for the dumb question.

echo $PATH helps you diagnose the problem with your path
your system python should be in /usr/bin
For modifying your PATH I would point you to https://superuser.com/questions/488173/how-can-i-edit-the-path-on-linux

1 Like

Thanks for your help & patience. I am gonna give this a shot in a bit!

I don’t know whether or not you’re yanking some chain, but whenever you write something like this

sudo apt install requirements.txt

you need to take a step back and read some manuals.

1 Like

This was my desperation to get anything to work because this has been a gargantuan pain in my ass.

Regardless of what the actual problem with your system is, none of these things will ever work:

pip install flood.py
pip install soup.py
pipx install setup.py
sudo apt install requirements.txt

Here are the steps you need to take.

  1. Find out which package you want to install. Locate it on pypi.org.
  2. Activate your virtual env like above (it should say (myenv) at the beginning of the line).
  3. Run pip install [the package name goes here].
  4. If it fails, copy/paste the output here.
2 Likes