MagicStack / MagicStack/asyncpg
import asyncpg locally with compilation error
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Python
- Estrellas
- 8.1k
- Forks
- 468
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
* **asyncpg version**:
Forked the code to local a few months back. Couldn't find the version number.
* **PostgreSQL version**:
11
* **Do you use a PostgreSQL SaaS? If so, which? Can you reproduce
the issue with a local PostgreSQL install?**:
* **Python version**:
3.6.5
* **Platform**:
Mac 10.13
* **Do you use pgbouncer?**:
No
* **Did you install asyncpg with pip?**:
No
* **If you built asyncpg locally, which version of Cython did you use?**:
0.29.15
* **Can the issue be reproduced under both asyncio and
[uvloop](https://github.com/magicstack/uvloop)?**:
Trying to import asyncpg locally on my Mac. But have the compilation error. I have the below ```
import statements.
import sys
print(sys.path)
sys.path.append(".")
import asyncio
from aiohttp import web
import pyximport
pyximport.install()
import asyncpg.asyncpg
os.environ['PYTHONASYNCIODEBUG'] = '1'
os.environ['MACOSX_DEPLOYMENT_TARGET'] = '10.13'
import logging
import time
```
But get the error.
> Compiler crash traceback from this point on:
> File "/Users/i3ye/Programming/vsc/ppx-git/venv/lib/python3.6/site-packages/Cython/Compiler/ExprNodes.py", line 6832, in infer_type
> return node.entry.type
> AttributeError: 'NoneType' object has no attribute 'type'
> /Users/i3ye/.pyxbld/temp.macosx-10.6-intel-3.6/pyrex/asyncpg/asyncpg/protocol/protocol.c:1:2: error: Do not use this file, it is the result of a
> failed Cython compilation.
> #error Do not use this file, it is the result of a failed Cython compilation.
> ^
> 1 error generated.
> Traceback (most recent call last):
> File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/unixccompiler.py", line 118, in _compile
> extra_postargs)
> File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/ccompiler.py", line 909, in spawn
> spawn(cmd, dry_run=self.dry_run)
> File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/spawn.py", line 36, in spawn
> _spawn_posix(cmd, search_path, dry_run=dry_run)
> File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/spawn.py", line 159, in _spawn_posix
> % (cmd, exit_status))
> distutils.errors.DistutilsExecError: command 'gcc' failed with exit status 1
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
> File "/Users/i3ye/Programming/vsc/ppx-git/venv/lib/python3.6/site-packages/pyximport/pyximport.py", line 215, in load_module
> inplace=build_inplace, language_level=language_level)
> File "/Users/i3ye/Programming/vsc/ppx-git/venv/lib/python3.6/site-packages/pyximport/pyximport.py", line 191, in build_module
> reload_support=pyxargs.reload_support)
> File "/Users/i3ye/Programming/vsc/ppx-git/venv/lib/python3.6/site-packages/pyximport/pyxbuild.py", line 102, in pyx_to_dll
> dist.run_commands()
> File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 955, in run_commands
> self.run_command(cmd)
> File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 974, in run_command
> cmd_obj.run()
> File "/Users/i3ye/Programming/vsc/ppx-git/venv/lib/python3.6/site-packages/Cython/Distutils/old_build_ext.py", line 186, in run
> _build_ext.build_ext.run(self)
> File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/command/build_ext.py", line 339, in run
> self.build_extensions()
> File "/Users/i3ye/Programming/vsc/ppx-git/venv/lib/python3.6/site-packages/Cython/Distutils/old_build_ext.py", line 195, in build_extensions
> _build_ext.build_ext.build_extensions(self)
> File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/command/build_ext.py", line 448, in build_extensions
> self._build_extensions_serial()
> File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/command/build_ext.py", line 473, in _build_extensions_serial
> self.build_extension(ext)
> File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/command/build_ext.py", line 533, in build_extension
> depends=ext.depends)
> File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/ccompiler.py", line 574, in compile
> self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
> File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/unixccompiler.py", line 120, in _compile
> raise CompileError(msg)
> distutils.errors.CompileError: command 'gcc' failed with exit status 1
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
> File "nowebpool.py", line 8, in
> import asyncpg.asyncpg
> File "/Users/i3ye/Programming/vsc/ppx-git/asyncpg/asyncpg/__init__.py", line 8, in
> from .connection import connect, Connection # NOQA
> File "/Users/i3ye/Programming/vsc/ppx-git/asyncpg/asyncpg/connection.py", line 20, in
> from . import connect_utils
> File "/Users/i3ye/Programming/vsc/ppx-git/asyncpg/asyncpg/connect_utils.py", line 27, in
> from . import protocol
> File "/Users/i3ye/Programming/vsc/ppx-git/asyncpg/asyncpg/protocol/__init__.py", line 8, in
> from .protocol import Protocol, Record, NO_TIMEOUT # NOQA
> File "/Users/i3ye/Programming/vsc/ppx-git/venv/lib/python3.6/site-packages/pyximport/pyximport.py", line 462, in load_module
> language_level=self.language_level)
> File "/Users/i3ye/Programming/vsc/ppx-git/venv/lib/python3.6/site-packages/pyximport/pyximport.py", line 231, in load_module
> raise exc.with_traceback(tb)
> File "/Users/i3ye/Programming/vsc/ppx-git/venv/lib/python3.6/site-packages/pyximport/pyximport.py", line 215, in load_module
> inplace=build_inplace, language_level=language_level)
> File "/Users/i3ye/Programming/vsc/ppx-git/venv/lib/python3.6/site-packages/pyximport/pyximport.py", line 191, in build_module
> reload_support=pyxargs.reload_support)
> File "/Users/i3ye/Programming/vsc/ppx-git/venv/lib/python3.6/site-packages/pyximport/pyxbuild.py", line 102, in pyx_to_dll
> dist.run_commands()
> File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 955, in run_commands
> self.run_command(cmd)
> File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 974, in run_command
> cmd_obj.run()
> File "/Users/i3ye/Programming/vsc/ppx-git/venv/lib/python3.6/site-packages/Cython/Distutils/old_build_ext.py", line 186, in run
> _build_ext.build_ext.run(self)
> File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/command/build_ext.py", line 339, in run
> self.build_extensions()
> File "/Users/i3ye/Programming/vsc/ppx-git/venv/lib/python3.6/site-packages/Cython/Distutils/old_build_ext.py", line 195, in build_extensions
> _build_ext.build_ext.build_extensions(self)
> File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/command/build_ext.py", line 448, in build_extensions
> self._build_extensions_serial()
> File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/command/build_ext.py", line 473, in _build_extensions_serial
> self.build_extension(ext)
> File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/command/build_ext.py", line 533, in build_extension
> depends=ext.depends)
> File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/ccompiler.py", line 574, in compile
> self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
> File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/unixccompiler.py", line 120, in _compile
> raise CompileError(msg)
> ImportError: Building module asyncpg.asyncpg.protocol.protocol failed: ["distutils.errors.CompileError: command 'gcc' failed with exit status 1\n"]
>
>
> gcc --version
> Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
> Apple clang version 11.0.0 (clang-1100.0.33.17)
> Target: x86_64-apple-darwin18.7.0
> Thread model: posix
> InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Reproduce la importación desde nowebpool.py usando Python 3.6.5, macOS 10.13, PostgreSQL 11 y Cython 0.29.15. Empieza con asyncpg/protocol/__init__.py y el traceback del compilador para el módulo protocol; se considera terminado cuando asyncpg se pueda importar localmente sin el fallo de Cython o gcc.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- postgresql, python
- Área
- databases
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 25/100