linkedin / linkedin/shiv

asyngpg doesn't work due to c-bindings

Open
#202 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.9k
Forks
114
PR merge metrics
No merged PRs in 30d

Description

Hi,

I am currently compiling using the following command:

`shiv --site-packages .env\Lib\site-packages -c runx -o runx.pyz`

"runx" is a custom console app I have packaged.

asyncpg is one of the dependencies.

However when I run `C:\python310\python.exe runx.pyz`, I get the following error:

```
File "\site-packages\psccommon\db\db.py", line 4, in
import asyncpg
File "\site-packages\asyncpg\__init__.py", line 8, in
from .connection import connect, Connection # NOQA
File "\site-packages\asyncpg\connection.py", line 19, in
from . import connect_utils
File "\site-packages\asyncpg\connect_utils.py", line 27, in
from . import protocol
File "\site-packages\asyncpg\protocol\__init__.py", line 8, in
from .protocol import Protocol, Record, NO_TIMEOUT # NOQA
ModuleNotFoundError: No module named 'asyncpg.protocol.protocol'
```

Note that this is on a different machine to the build machine, however they are both Windows 10 builds.

What can I do to mitigate this?

Thanks

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the shiv command on Windows with an application that depends on asyncpg, using the traceback as the starting point. Compare the build and target environments and inspect whether asyncpg.protocol.protocol is included in the generated archive; done means the packaged application imports asyncpg successfully on the second Windows machine.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system, cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.