Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem building package for Django 1.9 #709

Closed
ivoflipse opened this issue Dec 15, 2015 · 7 comments
Closed

Problem building package for Django 1.9 #709

ivoflipse opened this issue Dec 15, 2015 · 7 comments
Labels
locked [bot] locked due to inactivity

Comments

@ivoflipse
Copy link

I'm trying to build a package for Django 1.9. I created a recipe using conda skeleton pypi django and left the recipe untouched.

Then when running conda build django on a Windows 7 PC with Miniconda 2 (64 bit) I get the following error:

installing scripts to build\bdist.win-amd64\egg\EGG-INFO\scripts
running install_scripts
running build_scripts
creating build\scripts-2.7
copying and adjusting django\bin\django-admin.py -> build\scripts-2.7
creating build\bdist.win-amd64\egg\EGG-INFO\scripts
copying build\scripts-2.7\django-admin.py -> build\bdist.win-amd64\egg\EGG-INFO\scripts
copying Django.egg-info\PKG-INFO -> build\bdist.win-amd64\egg\EGG-INFO
copying Django.egg-info\SOURCES.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying Django.egg-info\dependency_links.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying Django.egg-info\entry_points.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying Django.egg-info\not-zip-safe -> build\bdist.win-amd64\egg\EGG-INFO
copying Django.egg-info\requires.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying Django.egg-info\top_level.txt -> build\bdist.win-amd64\egg\EGG-INFO
creating dist
creating 'dist\Django-1.9-py2.7.egg' and adding 'build\bdist.win-amd64\egg' to it
removing 'build\bdist.win-amd64\egg' (and everything under it)
Processing Django-1.9-py2.7.egg
creating c:\users\admin\miniconda2\envs\_build\lib\site-packages\Django-1.9-py2.7.egg
Extracting Django-1.9-py2.7.egg to c:\users\admin\miniconda2\envs\_build\lib\site-packages
  File "c:\users\admin\miniconda2\envs\_build\lib\site-packages\Django-1.9-py2.7.egg\django\conf\app_template\apps.py", line 4
    class {{ camel_case_app_name }}Config(AppConfig):
          ^
SyntaxError: invalid syntax

  File "c:\users\admin\miniconda2\envs\_build\lib\site-packages\Django-1.9-py2.7.egg\django\conf\app_template\models.py", line 1
    {{ unicode_literals }}from django.db import models
                             ^
SyntaxError: invalid syntax

Adding Django 1.9 to easy-install.pth file
Installing django-admin.py script to C:\Users\Admin\Miniconda2\envs\_build\Scripts
Deleting C:\Users\Admin\Miniconda2\envs\_build\Scripts\django-admin.py
Installing django-admin-script.py script to C:\Users\Admin\Miniconda2\envs\_build\Scripts
Installing django-admin.exe script to C:\Users\Admin\Miniconda2\envs\_build\Scripts

Installed c:\users\admin\miniconda2\envs\_build\lib\site-packages\django-1.9-py2.7.egg
Processing dependencies for Django==1.9
Finished processing dependencies for Django==1.9

Admin@ADMIN-PC C:\Users\Admin\Miniconda2\conda-bld\work\Django-1.9
> if errorlevel 1 exit 1
found egg dir: C:\Users\Admin\Miniconda2\envs\_build\Lib\site-packages\Django-1.9-py2.7.egg
compiling .pyc files...
Compiling C:\Users\Admin\Miniconda2\envs\_build\Lib\site-packages\django\conf\app_template\apps.py ...
  File "C:\Users\Admin\Miniconda2\envs\_build\Lib\site-packages\django\conf\app_template\apps.py", line 4
    class {{ camel_case_app_name }}Config(AppConfig):
          ^
SyntaxError: invalid syntax

Compiling C:\Users\Admin\Miniconda2\envs\_build\Lib\site-packages\django\conf\app_template\models.py ...
  File "C:\Users\Admin\Miniconda2\envs\_build\Lib\site-packages\django\conf\app_template\models.py", line 1
    {{ unicode_literals }}from django.db import models
                             ^
SyntaxError: invalid syntax

Command failed: C:\Users\Admin\Miniconda2\envs\_build\python.exe -Wi C:\Users\Admin\Miniconda2\envs\_build\Lib\compileall.py -q -x port_v3 C:\Users\Admin\Miniconda2\envs\_build\Lib\site-packages

I'm using the following configuration:

> conda info
Current conda install:

             platform : win-64
        conda version : 3.18.9
  conda-build version : 1.18.2
       python version : 2.7.11.final.0
     requests version : 2.8.1
     root environment : C:\Users\Admin\Miniconda2  (writable)
  default environment : C:\Users\Admin\Miniconda2
     envs directories : C:\Users\Admin\Miniconda2\envs
        package cache : C:\Users\Admin\Miniconda2\pkgs
         channel URLs : https://conda.anaconda.org/t/<TOKEN>/clinicalgraphics/win-64/
                        https://conda.anaconda.org/t/<TOKEN>/clinicalgraphics/noarch/
                        https://repo.continuum.io/pkgs/free/win-64/
                        https://repo.continuum.io/pkgs/free/noarch/
                        https://repo.continuum.io/pkgs/pro/win-64/
                        https://repo.continuum.io/pkgs/pro/noarch/
          config file : C:\Users\Admin\.condarc
    is foreign system : False

> conda list
# packages in environment at C:\Users\Admin\Miniconda2:
#
anaconda-client           1.2.1                    py27_0    defaults
bzip2                     1.0.6                     vc9_2  [vc9]  defaults
clyent                    1.2.0                    py27_0    defaults
conda                     3.18.9                   py27_0    defaults
conda-build               1.18.2                   py27_0    defaults
conda-env                 2.4.5                    py27_0    defaults
freetype                  2.5.5                     vc9_0  [vc9]  defaults
jinja2                    2.8                      py27_0    defaults
jpeg                      8d                        vc9_0  [vc9]  defaults
libpng                    1.6.17                    vc9_1  [vc9]  defaults
libtiff                   4.0.6                     vc9_1  [vc9]  defaults
markupsafe                0.23                     py27_0    defaults
menuinst                  1.3.1                    py27_0    defaults
msvc_runtime              1.0.1                     vc9_0  [vc9]  defaults
patch                     2.5.9                         1    defaults
pillow                    3.0.0                    py27_1    defaults
pip                       7.1.2                    py27_0    defaults
psutil                    3.2.2                    py27_0    defaults
pycosat                   0.6.1                    py27_0    <unknown>
pycrypto                  2.6.1                    py27_3    <unknown>
python                    2.7.11                        0    defaults
python-dateutil           2.4.2                    py27_0    defaults
pytz                      2015.7                   py27_0    defaults
pyyaml                    3.11                     py27_2    <unknown>
requests                  2.8.1                    py27_0    <unknown>
setuptools                18.8.1                   py27_0    defaults
six                       1.10.0                   py27_0    defaults
wheel                     0.26.0                   py27_1    defaults
zlib                      1.2.8                     vc9_2  [vc9]  defaults

This problem was introduced in the latest release and the proposed solution was to update to the latest version of setuptools, which I'm using.

It seems related to the pyc_compilation, which tries to compile a .py file which contains invalid Python code. So I guess my problem is related to this issue.

What would be the best way to fix this?

@jakirkham
Copy link
Member

Have you tried setting PYTHONDONTWRITEBYTECODE? I think that would be worth a shot. Could be tacked on in the build.sh and bld.bat.

@jakirkham
Copy link
Member

FWIW, this problem does not occur with the most recent Django 1.9.2.

@Korijn
Copy link
Contributor

Korijn commented Jul 12, 2016

I also stopped encountering this problem for Django 1.9.7. Not sure why... I guess we can close it.

@msarahan
Copy link
Contributor

Since I have not intentionally fixed this, I'm reopening. Glad you're not having trouble in the meantime, though.

@msarahan msarahan reopened this Jul 12, 2016
@msarahan
Copy link
Contributor

As of the 1.21.11 release, we now try to compile, but do not crash on failure. This was added by @minrk in #1146. I think this closes this issue - but please reopen or open a new issue if we need further discussion.

@ivoflipse
Copy link
Author

Thanks @msarahan!

@github-actions
Copy link

Hi there, thank you for your contribution!

This issue has been automatically locked because it has not had recent activity after being closed.

Please open a new issue if needed.

Thanks!

@github-actions github-actions bot added the locked [bot] locked due to inactivity label Apr 21, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked [bot] locked due to inactivity
Projects
None yet
Development

No branches or pull requests

4 participants