# Difficulty installing a GitHub package

**URL:** <https://discuss.python.org/t/difficulty-installing-a-github-package/16305>\
**Category:** Python Help\
**Tags:** help\
**Created:** [June 6, 2022, 9:56pm UTC](https://discuss.python.org/t/difficulty-installing-a-github-package/16305 "2022-06-06T21:56:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![owsoni](https://avatars.discourse-cdn.com/v4/letter/o/5fc32e/32.png) [@owsoni](https://discuss.python.org/u/owsoni)\
**Post date:** [June 6, 2022, 9:56pm UTC](https://discuss.python.org/t/difficulty-installing-a-github-package/16305/1 "2022-06-06T21:56:15Z")

</div>

I am a novice drone pilot/programmer and could use some help. I am trying use a repository from GitHub called “pyulog” that will allow me to read and edit data from a simulated flight in a .csv file.

I am trying to convert a .ulg file that I got from a jMavSim simulation to .csv using pyulog, but I am unable use the ulog2csv command, along with any other command in the pyulog repository. I have installed python and downloaded the pyulog zip files from GitHub, and I am pretty sure I have installed it correctly using the following line entered into my terminal (Windows 11):

```auto
py -m pip install pyulog

```

I have tried extracting the file from github to both C:\Users[my username] and to downloads, as well as changing the directory in the terminal. But whenever I attempt to use either ulog\_info or ulog2csv the error says that the file “doesn’t exist” or that “ **main** ” cannot be found. It doesn’t seem like anyone else has had a similar issue on these forums or on the drone forums, so I believe that the problem lies with my inexperience with GitHub and programming in general. I would appreciate any advice or instruction that y’all would be willing to give. Thank you.

---

<div class="post-metadata">

**Author:** ![vbrozik](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/vbrozik/32/7423_2.png) [@vbrozik](https://discuss.python.org/u/vbrozik)\
**Post date:** [June 6, 2022, 11:02pm UTC](https://discuss.python.org/t/difficulty-installing-a-github-package/16305/2 "2022-06-06T23:02:24Z")

</div>

The command `py -m pip install pyulog` does install the package neither from GitHub nor from a downloaded file but from the PyPI repository: [pyulog · PyPI](https://pypi.org/project/pyulog/) Anyway the repository currently contains probably the latest tagged release from GitHub.

The list [`console_scipts` in `setup.py`](https://github.com/PX4/pyulog/blob/master/setup.py#L56) defines names of executables which are added to a certain directory during installation. The directory should normally be accessible from your `PATH` - environment variable defining list of directories with executables. According to your description, the directory is not in your `PATH`. If so the executables cannot be found if you try to execute them just by their name.

For installing packages I normally use [`venv`](https://docs.python.org/3/library/venv.html#module-venv) (virtual environment). It is a built-in tool which creates a directory in which all packages will be installed. This way you have a great control over where everything will go including the executables.

The procedure below is for Unix-like systems (Windows differ somewhat):

```bash
python3 -m venv pyulog_venv # create the venv - The last argument is the directory to be created. The directory will contain everything installed when the venv is active.
source pyulog_venv/bin/activate # activate the venv (adds its bin/ directory to my PATH)
pip install -U pip setuptools # update the basic pre-installed packages
pip install pyulog # install the package

```

The installation creates the executables in the directory `pyulog_venv/bin/` which was temporarily added to my `PATH` by sourcing the `activate` script.

---

<div class="post-metadata">

**Author:** ![cameron](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/cameron/32/2658_2.png) [@cameron](https://discuss.python.org/u/cameron)\
**Post date:** [June 6, 2022, 11:25pm UTC](https://discuss.python.org/t/difficulty-installing-a-github-package/16305/3 "2022-06-06T23:25:48Z")

</div>

By Owen Dunston via Discussions on [Python.org](http://Python.org) at 06Jun2022 22:06:

> I am a novice drone pilot/programmer and could use some help. I am  
> trying use a repository from GitHub called “pyulog” that will allow me  
> to read and edit data from a simulated flight in a .csv file.
> 
> I am trying to convert a .ulg file that I got from a jMavSim simulation to .csv using pyulog, but I am unable use the ulog2csv command, along with any other command in the pyulog repository. I have installed python and downloaded the pyulog zip files from GitHub, and I am pretty sure I have installed it correctly using the following line entered into my terminal (Windows 11):
> 
> ```auto
> py -m pip install pyulog
> 
> ```

That should work. I’ve never used pyulog, but running the above command  
here installed `ulog2csv` and a bunch of other `ulog*` commands.

Note that these commands land in the `bin` directory of the environment  
in which the `pyulog` package was installed.

When I ran this as a plain “user” pip install I got this warning:

```
WARNING: The scripts ulog2csv, ulog2kml, ulog_extract_gps_dump, ulog_info, ulog_messages and ulog_params are installed in '/Users/cameron/Library/Python/3.10/bin' which is not on PATH.

```

I’m on a Mac, so the path will be different on your system. But basicly,  
it should have installed the commands in your personal python area and  
it looks like that area’s `bin` subdirectory is not in your %path  
variable, so the commands, though installed, are not found.

I’m not a windows person, so I can’t provide the windows specifics to  
fix this, but I expect it to amount to adding something to %path.

Have a look here:

> **[4. Using Python on Windows](https://docs.python.org/3/using/windows.html#configuring-python)**
>
> This document aims to give an overview of Windows-specific behaviour you should know about when using Python on Microsoft Windows. Unlike most Unix systems and services, Windows does not include a ...

There are two specific variables of interest: `%PATH%` which is where  
the command prompt searches for command names, and `%PYTHONPATH%` which  
is where Python itself search for modules/packages like `pyulog`.

You should not need to worry about `%PYTHONPATH%`; by using `py -m pip install pyulog` the module should already be installed in the right  
place. But you may need to adjust `%PATH%` to find the command line  
tools that came with it.

Cheers,  
Cameron Simpson [cs@cskk.id.au](mailto:cs@cskk.id.au)

---

<div class="post-metadata">

**Author:** ![steven.daprano](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/steven.daprano/32/1083_2.png) [@steven.daprano](https://discuss.python.org/u/steven.daprano)\
**Post date:** [June 7, 2022, 12:01am UTC](https://discuss.python.org/t/difficulty-installing-a-github-package/16305/4 "2022-06-07T00:01:06Z")

</div>

If you have successfully installed the pyulog package using pip, you don’t also have to install from Github.

Owen says:

“whenever I attempt to use either ulog\_info or ulog2csv the error says that the file “doesn’t exist” or that “ **main** ” cannot be found.”

Please tell us exactly what “attempt to use” means. If there an icon on your desktop that you double-click, or a Start menu item? Or do you type a command at [command.com](http://command.com) or Powershell or cmd.exe? Or something else?

If you are typing a command, tell us _exactly_ what command you are typing, the directory you are in, and the _exact_ error message (if possible). Preferably copy and paste the command rather than retype it or taking a screen shot.

---

<div class="post-metadata">

**Author:** ![owsoni](https://avatars.discourse-cdn.com/v4/letter/o/5fc32e/32.png) [@owsoni](https://discuss.python.org/u/owsoni)\
**Post date:** [June 7, 2022, 4:53pm UTC](https://discuss.python.org/t/difficulty-installing-a-github-package/16305/5 "2022-06-07T16:53:12Z")

</div>

It worked! I created the virtual environment using a method similar to what you posted except adjusted for Windows 11. Thank you 🏅 😃
