8000 trouble with installing · Issue #1231 · mininet/mininet · GitHub
[go: up one dir, main page]

Skip to content

trouble with installing #1231

Open

Description

@ssjd08

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.

  1. 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 8000 pycodestyle .

  1. 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.

  1. 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.

Activity

  1. jafingerhut commented on Sep 19, 2024

    @jafingerhut

    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.

  2. liquorice111 commented on Oct 23, 2024

    @liquorice111

    hello,do you solve your problem?I met the same problem

  3. ssjd08 commented on Oct 23, 2024

    @ssjd08
    Author

    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.

  4. Wangningsen commented on Nov 20, 2024

    @Wangningsen

    exactly the same situation, but mine is ubuntu 22.04.

    cc -Wall -Wextra  \
    -DVERSION=\"`PYTHONPATH=. python3 -B bin/mn --version 2>&1`\" mnexec.c -o mnexec
    <command-line>: warning: missing terminating " character
    mnexec.c: In function ‘main’:
    <command-line>: 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

    I solved this problem with the assitance of GPT, first I run this in /miniset:

    PYTHONPATH=. python3 -B bin/mn --version

    I get an error:

    wangningsen@wangningsen-virtual-machine:~/mininet$ export PYTHONPATH=$PYTHONPATH:~/mininet
    wangningsen@wangningsen-virtual-machine:~/mininet$ PYTHONPATH=. python3 -B bin/mn --version
    Traceback (most recent call last):
      File "/home/wangningsen/mininet/bin/mn", line 45, in <module>
        from mininet.examples.cluster import ( MininetCluster, RemoteHost,
    ModuleNotFoundError: No module named 'mininet.examples'

    Then I check mininet/mininet/examples by this:

    wangningsen@wangningsen-virtual-machine:~/mininet$ ls -ld ~/mininet/mininet/examples

    And I get this:

    wangningsen@wangningsen-virtual-machine:~/mininet$ ls -ld ~/mininet/mininet/examples
    -rwxrwxrwx 1 wangningsen wangningsen 11 11月 20 17:49 /home/wangningsen/mininet/mininet/examples

    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:

    • Delete the broken examples link or file:
    rm ~/mininet/mininet/examples
    • Recreate the examples symlink:
    ln -s ../examples ~/mininet/mininet/examples

    then recheck it, we get the right symlink:

    wangningsen@wangningsen-virtual-machine:~/mininet$ ls -l ~/mininet/mininet/examples
    lrwxrwxrwx 1 wangningsen wangningsen 11 11月 20 17:55 /home/wangningsen/mininet/mininet/examples -> ../examples

    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.

  5. hpworld2165 commented on Feb 11, 2025

    @hpworld2165

    Same Problem. I want to use mininet wifi for my Project work. Are you able to use mininet-wifi as well after the solution?

  6. schneider8357 commented on Feb 17, 2025

    @schneider8357

    Same Problem. I want to use mininet wifi for my Project work. Are you able to use mininet-wifi as well after the solution?

    @hpworld2165 I believe in mininet-wifi this was fixed:
    intrig-unicamp/mininet-wifi#536

  7. TrailToTerminal commented on Jun 24, 2025

    @TrailToTerminal

    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.

    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?

    thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0