fedora-python / python-ethtool

Deprecated Python bindings for the ethtool kernel interface
GNU General Public License v2.0
15 stars 13 forks source link

ld: cannot find -lnl-route-3 #34

Closed IamSierraCharlie closed 7 years ago

IamSierraCharlie commented 7 years ago

Hello, I'm seeing the following error:

Trying to install with python3 3.5.2 (default, Nov 17 2016, 17:05:23) [GCC 5.4.0 20160609]

Admittedly, I'm on Ubuntu 16.04 - not sure if that is a significant issue with this version of python-ethtool This is the last bit of the install attempt after running

sudo -H python3 setup.py install

x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.5/python-ethtool/ethtool.o build/temp.linux-x86_64-3.5/python-ethtool/etherinfo.o build/temp.linux-x86_64-3.5/python-ethtool/etherinfo_obj.o build/temp.linux-x86_64-3.5/python-ethtool/netlink.o build/temp.linux-x86_64-3.5/python-ethtool/netlink-address.o -lnl-3 -lnl-route-3 -o build/lib.linux-x86_64-3.5/ethtool.cpython-35m-x86_64-linux-gnu.so /usr/bin/ld: cannot find -lnl-route-3 collect2: error: ld returned 1 exit status error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

I can't find anything on this error searching (or I'm not searching for the right thing. My knowledge in python is not the best. Appreciate any feedback you might be able to offer...

IamSierraCharlie commented 7 years ago

Sorry - I've jumped the gun

this is resolved by running sudo apt install libnl-route-3-dev

hopefully this helps someone else running Ubuntu 16.04.3 LTS

hroncok commented 7 years ago

We might want to document this.

maurorodrigues commented 6 years ago

For the record, and to help with documentation, I ended up with the same error, but before that I was seeing the follow:

The directory '/home/maurosr/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/maurosr/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting ethtool
  Downloading ethtool-0.13.tar.gz (44kB)
    100% |████████████████████████████████| 51kB 196kB/s 
Installing collected packages: ethtool
  Running setup.py install for ethtool ... error
    Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-zvx3bZ/ethtool/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-I8rHGD-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_ext
    building 'ethtool' extension
    Failed to query pkg-config --cflags-only-I libnl-3.0

    ----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-zvx3bZ/ethtool/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-I8rHGD-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-zvx3bZ/ethtool/

then I installed libnl-3-dev, and saw the same error of this issue, fixed with the same libnl-route-3-dev

frenzymadness commented 6 years ago

@maurorodrigues @IamSierraCharlie Anybody interested in testing the new installation guide? https://github.com/fedora-python/python-ethtool/pull/42