hello
I am trying to install mininet on my Ubuntu 24.04 noble amd64, but there is a problem.
just to let you know I wanna explain the issues I deal with them till this step of installation.
after I ran command '~/mininet/util/install.sh -a' I got the error :
E: Package 'pep8' has no installation candidate
for this error I opend the install.sh file and replaced all pep8 with pycodestyle .
after trying again I got error: externally-managed-environment
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-Debian-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 python3-full installed.
If you wish to install a non-Debian 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.
See /usr/share/doc/python3.12/README.venv for more information.
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.'
for this problem I create and activated python env and tried again.
the third and my unsoled problem when I run '~/mininet/util/install.sh -a', I get this error:
: warning: missing terminating " character
mnexec.c: In function ‘main’:
: error: missing terminating " character
mnexec.c:208:28: note: in expansion of macro ‘VERSION’
208 | printf("%s\n", VERSION);
| ^~~~~~~
mnexec.c:208:35: error: expected expression before ‘)’ token
208 | printf("%s\n", VERSION);
| ^
make: *** [Makefile:50: mnexec] Error 1'
if anyone know what should I do, please help me to resolve the problem or install the mininet from begining.
thank you.
Warning: Some of those changes might not be appropriate for all users. I was focused on Ubuntu 20.04, 22.04, and 24.04, and for a little while Fedora Linux, and not necessarily installing all Mininet options.
hello
Fortunately yes.
the solution that worked for me is in the below:
1.install mininet-wifi first.
2.cd to mininet-wifi/util
3.using "gedit install.sh" find and replace all "pep8" with "pycodestyle". save and exit. you can do it with gedit or enything you know.
4.run "sudo install.sh -Wlnfv" and install it.
at this point I think you can you use mininet and "mn" command.
I will glad to help you if the problem didn't solve.
Am having two similar problems to what's described above. I am using Ubuntu 24.04.2 LTS. First one was the same about the virtual environment that @ssjd08 mentioned. Without PIP I got the following:
× 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-Debian-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 python3-full installed.
If you wish to install a non-Debian 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.
See /usr/share/doc/python3.12/README.venv for more information.
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.
python3 -m pip install .**
So then I tired a PIP Virtual environment and tried with the (.venv) at the prompt. This time I got
Installing Mininet core
~/mininet ~
install -D mnexec /usr/bin/mnexec
install -D -t /usr/share/man/man1 mn.1 mnexec.1
python -m pip uninstall -y mininet || true
/bin/sh: 1: python: not found
python -m pip install .
make: python: No such file or directory
make: *** [Makefile:61: install] Error 127
What is supposed to be used for the virtual environment?
Once I tried the virtual environment, how come I now have this new error 127 with the directories? what is the fix for this?
Activity
jafingerhut commentedon Sep 19, 2024
I have not submitted a PR to mininet for this, but have been using a local patch on top of mininet in order to modify a few things like this: https://github.com/jafingerhut/p4-guide/blob/master/bin/patches/mininet-patch-for-2023-jun-enable-venv.patch
Warning: Some of those changes might not be appropriate for all users. I was focused on Ubuntu 20.04, 22.04, and 24.04, and for a little while Fedora Linux, and not necessarily installing all Mininet options.
liquorice111 commentedon Oct 23, 2024
hello,do you solve your problem?I met the same problem
ssjd08 commentedon Oct 23, 2024
hello
Fortunately yes.
the solution that worked for me is in the below:
1.install mininet-wifi first.
2.cd to mininet-wifi/util
3.using "gedit install.sh" find and replace all "pep8" with "pycodestyle". save and exit. you can do it with gedit or enything you know.
4.run "sudo install.sh -Wlnfv" and install it.
at this point I think you can you use mininet and "mn" command.
I will glad to help you if the problem didn't solve.
Wangningsen commentedon Nov 20, 2024
exactly the same situation, but mine is ubuntu 22.04.
I solved this problem with the assitance of GPT, first I run this in /miniset:
I get an error:
Then I check mininet/mininet/examples by this:
And I get this:
The examples directory in ~/mininet/mininet was not a proper directory but instead was a regular file or an invalid symlink.
I fix this as follows:
rm ~/mininet/mininet/examplesln -s ../examples ~/mininet/mininet/examplesthen recheck it, we get the right symlink:
Eventually run install.sh, we will see it can actually install.
Also I met several problems of CRLF, for example the install.sh and the /usr/local/bin/mn after install. But they can be easily fixed by dos2unix.
hpworld2165 commentedon Feb 11, 2025
Same Problem. I want to use mininet wifi for my Project work. Are you able to use mininet-wifi as well after the solution?
schneider8357 commentedon Feb 17, 2025
@hpworld2165 I believe in mininet-wifi this was fixed:
intrig-unicamp/mininet-wifi#536
TrailToTerminal commentedon Jun 24, 2025
Am having two similar problems to what's described above. I am using Ubuntu 24.04.2 LTS. First one was the same about the virtual environment that @ssjd08 mentioned. Without PIP I got the following:
**Installing Mininet core
/home/ubuntu/mininet /home/ubuntu
install -D mnexec /usr/bin/mnexec
install -D -t /usr/share/man/man1 mn.1 mnexec.1
python3 -m pip uninstall -y mininet || true
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.
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.
python3 -m pip install .**
So then I tired a PIP Virtual environment and tried with the (.venv) at the prompt. This time I got
Installing Mininet core
~/mininet ~
install -D mnexec /usr/bin/mnexec
install -D -t /usr/share/man/man1 mn.1 mnexec.1
python -m pip uninstall -y mininet || true
/bin/sh: 1: python: not found
python -m pip install .
make: python: No such file or directory
make: *** [Makefile:61: install] Error 127
What is supposed to be used for the virtual environment?
Once I tried the virtual environment, how come I now have this new error 127 with the directories? what is the fix for this?
thanks!
Fix installation on Ubuntu 24.04 (Handle pep8 rename and PEP 668) min…