[SOLVED]cfclient for linux doesn't work

Post here to get support
ben
Beginner
Posts: 20
Joined: Fri Jun 16, 2017 9:24 pm

[SOLVED]cfclient for linux doesn't work

Post by ben »

After having some trouble with the virtual machine and the z-ranger deck I decided to try and download the native client for linux to see if that would work any better, or really work at all. I'm running Ubuntu 14.04 and ran the exact commands given on the 'Getting started with Crazyflie 2.0' website, but it refused to install because it didn't recognize 'setup.py' after running pip3 install -e . any suggestions?
Last edited by ben on Wed Jul 05, 2017 5:59 pm, edited 1 time in total.
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: cfclient for linux doesn't work

Post by arnaud »

Where do you launch the command? This command needs to be launched in the source folder.

An alternative you could try would be to install the release directly from pypi using "pip install cfclient". This way you will not need to download the source code but you will also not be able to work on the source code, so it is fine if you did not intend to modify the client.
ben
Beginner
Posts: 20
Joined: Fri Jun 16, 2017 9:24 pm

Re: cfclient for linux doesn't work

Post by ben »

I have tried launching the command in the source folder, and I have just now tried to launch the command you gave me. Both of them fail with the output being 'command python setup.py egg_info failed with error code 1 in <directory>.' Then it stores the debug log for failure in pip.log, which I can't access via the desktop application 'Files' because it's not there and I can't open in command line because it says 'Couldn't get a file descriptor referring to the console.'
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: cfclient for linux doesn't work

Post by arnaud »

Could you copy paste the full command output so that I can see what can go wrong?

For reference, on my computer using a python 3.6 anaconda environment I get:

Code: Select all

(py36) ~/crazyflie-clients-python$ pip install -e .
Obtaining file:///home/arnaud/dev/bitcraze/vanilia/crazyflie-clients-python
Requirement already satisfied: cflib>=0.1.1 in /home/arnaud/dev/bitcraze/vanilia/crazyflie-lib-python (from cfclient===2017.05-1-g069efa5-modified)
Requirement already satisfied: appdirs==1.4.0 in /home/arnaud/miniconda3/envs/py36/lib/python3.6/site-packages (from cfclient===2017.05-1-g069efa5-modified)
Requirement already satisfied: pyzmq in /home/arnaud/miniconda3/envs/py36/lib/python3.6/site-packages (from cfclient===2017.05-1-g069efa5-modified)
Requirement already satisfied: pyqtgraph>=0.10 in /home/arnaud/miniconda3/envs/py36/lib/python3.6/site-packages (from cfclient===2017.05-1-g069efa5-modified)
Requirement already satisfied: pyusb>=1.0.0b2 in /home/arnaud/miniconda3/envs/py36/lib/python3.6/site-packages (from cflib>=0.1.1->cfclient===2017.05-1-g069efa5-modified)
Requirement already satisfied: numpy in /home/arnaud/miniconda3/envs/py36/lib/python3.6/site-packages (from pyqtgraph>=0.10->cfclient===2017.05-1-g069efa5-modified)
Installing collected packages: cfclient
  Found existing installation: cfclient 2017.5
    Uninstalling cfclient-2017.5:
      Successfully uninstalled cfclient-2017.5
  Running setup.py develop for cfclient
Successfully installed cfclient
ben
Beginner
Posts: 20
Joined: Fri Jun 16, 2017 9:24 pm

Re: cfclient for linux doesn't work

Post by ben »

Here you go:

Code: Select all

qcal@qcal-ThinkPad-E560:~$ cd \crazyflie-clients-python-master
qcal@qcal-ThinkPad-E560:~/crazyflie-clients-python-master$ pip install -e .
Obtaining file:///home/qcal/crazyflie-clients-python-master
  Running setup.py (path:/home/qcal/crazyflie-clients-python-master/setup.py) egg_info for package from file:///home/qcal/crazyflie-clients-python-master
    Traceback (most recent call last):
      File "<string>", line 17, in <module>
      File "/home/qcal/crazyflie-clients-python-master/setup.py", line 18, in <module>
        raise "must use python 3.4 or greater"
    TypeError: exceptions must be old-style classes or derived from BaseException, not str
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 17, in <module>

  File "/home/qcal/crazyflie-clients-python-master/setup.py", line 18, in <module>

    raise "must use python 3.4 or greater"

TypeError: exceptions must be old-style classes or derived from BaseException, not str

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /home/qcal/crazyflie-clients-python-master
Storing debug log for failure in /home/qcal/.pip/pip.log

I've tried opening the debug log in file explorer, where I can't find it, and in the terminal, where it doesn't recognize the file.
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: cfclient for linux doesn't work

Post by arnaud »

This error is because you are using python 2 and not python 3. Can you try 'pip3 install -e .' instead?
ben
Beginner
Posts: 20
Joined: Fri Jun 16, 2017 9:24 pm

Re: cfclient for linux doesn't work

Post by ben »

Code: Select all

qcal@qcal-ThinkPad-E560:~$ cd crazyflie-clients-python-master
qcal@qcal-ThinkPad-E560:~/crazyflie-clients-python-master$ pip3 install -e .
Obtaining file:///home/qcal/crazyflie-clients-python-master
  Running setup.py (path:/home/qcal/crazyflie-clients-python-master/setup.py) egg_info for package from file:///home/qcal/crazyflie-clients-python-master
    fatal: Not a git repository (or any of the parent directories): .git
    Git is required to install from source.
    Please clone the project with Git or use one of the
    release pachages (either from pip or a binary build).
    Traceback (most recent call last):
      File "<string>", line 17, in <module>
      File "/home/qcal/crazyflie-clients-python-master/setup.py", line 53, in <module>
        raise Exception("Git required.")
    Exception: Git required.
    Complete output from command python setup.py egg_info:
    fatal: Not a git repository (or any of the parent directories): .git

Git is required to install from source.

Please clone the project with Git or use one of the

release pachages (either from pip or a binary build).

Traceback (most recent call last):

  File "<string>", line 17, in <module>

  File "/home/qcal/crazyflie-clients-python-master/setup.py", line 53, in <module>

    raise Exception("Git required.")

Exception: Git required.

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /home/qcal/crazyflie-clients-python-master
Storing debug log for failure in /home/qcal/.pip/pip.log
But here's the thing:

Code: Select all

qcal@qcal-ThinkPad-E560:~$ sudo apt-get install git
[sudo] password for qcal: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
git is already the newest version.
git set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 254 not upgraded.

So where do I go from here?
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: cfclient for linux doesn't work

Post by arnaud »

How did you get the project folder? From the error message it looks like you did not clone the project from git, which is required to run from source.

You can clone the project with git using the command:

Code: Select all

git clone https://github.com/bitcraze/crazyflie-clients-python
This will create the directory crazyflie-clients-python and clone the source code in it.
ben
Beginner
Posts: 20
Joined: Fri Jun 16, 2017 9:24 pm

Re: cfclient for linux doesn't work

Post by ben »

I had downloaded it off of github. I tried cloning it with the command you gave and it worked, but when I tried to install it said:

Code: Select all

Exception:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 283, in run
    requirement_set.install(install_options, global_options, root=options.root_path)
  File "/usr/lib/python3/dist-packages/pip/req.py", line 1436, in install
    requirement.install(install_options, global_options, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/pip/req.py", line 672, in install
    self.move_wheel_files(self.source_dir, root=root)
  File "/usr/lib/python3/dist-packages/pip/req.py", line 902, in move_wheel_files
    pycompile=self.pycompile,
  File "/usr/lib/python3/dist-packages/pip/wheel.py", line 206, in move_wheel_files
    clobber(source, lib_dir, True)
  File "/usr/lib/python3/dist-packages/pip/wheel.py", line 193, in clobber
    os.makedirs(destsubdir)
  File "/usr/lib/python3.4/os.py", line 237, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/usr/local/lib/python3.4/dist-packages/cfzmq'

arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: cfclient for linux doesn't work

Post by arnaud »

This is an access right problem: "pip3 install -e ." will install system-wide and for that you need to be root. "sudo pip3 install -e ." should work. If you do not want to install system wide you can use the --user flag as documented in the readme: "pip3 install --user -e .".

The advantage of installing system-wide is that you will then have cfclient in the path which makes it easier to launch it.
Post Reply