conda / conda-build

Commands and tools for building conda packages
https://docs.conda.io/projects/conda-build/
Other
383 stars 424 forks source link

ImportError: No module named requests #2520

Closed chandinijain closed 6 years ago

chandinijain commented 6 years ago

Trying to build a PyPi package with conda

when using conda skeleton pypi auquan_toolbox

Error:

conda skeleton pypi auquan_toolbox Warning, the following versions were found for auquan_toolbox 1.1.7 1.1.8 1.2.0 1.3.0 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 Using 2.0.8 Use --version to specify a different version. Using url https://files.pythonhosted.org/packages/7e/75/19711b1bc0a99196d0a75184792799592312935c3ec1ebcc9ec34cfa47c2/auquan_toolbox-2.0.8.tar.gz (39 KB) for auquan_toolbox. Downloading auquan_toolbox PyPI URL: https://files.pythonhosted.org/packages/7e/75/19711b1bc0a99196d0a75184792799592312935c3ec1ebcc9ec34cfa47c2/auquan_toolbox-2.0.8.tar.gz Using cached download Unpacking auquan_toolbox... done working in /var/folders/wb/7q8jsy0d29795q825mdg8n6c0000gn/T/tmpPeWuv0conda_skeleton_auquan_toolbox-2.0.8.tar.gz

The following NEW packages will be INSTALLED:

ca-certificates: 2017.08.26-ha1e5d58_0   
certifi:         2017.11.5-py27hfa9a1c4_0
libcxx:          4.0.1-h579ed51_0        
libcxxabi:       4.0.1-hebd6815_0        
libedit:         3.1-hb4e282d_0          
libffi:          3.2.1-h475c297_4        
ncurses:         6.0-hd04f020_2          
openssl:         1.0.2m-h86d3e6a_1       
python:          2.7.14-h001abdc_23      
pyyaml:          3.12-py27ha7932d0_1     
readline:        7.0-hc1231fa_4          
setuptools:      36.5.0-py27h2a45cec_0   
sqlite:          3.20.1-h7e4c145_2       
tk:              8.6.7-h35a86e2_3        
yaml:            0.1.7-hc338f04_2        
zlib:            1.2.11-hf3cbc9b_2       

Applying patch: u'/var/folders/wb/7q8jsy0d29795q825mdg8n6c0000gn/T/tmpPeWuv0conda_skeleton_auquan_toolbox-2.0.8.tar.gz/pypi-distutils.patch' Trying to apply patch as-is INFO:conda_build.source:Trying to apply patch as-is patching file core.py Hunk #1 succeeded at 169 with fuzz 2 (offset 2 lines). Traceback (most recent call last): File "setup.py", line 2, in from backtester.version import version File "/private/var/folders/wb/7q8jsy0d29795q825mdg8n6c0000gn/T/tmpPeWuv0conda_skeleton_auquan_toolbox-2.0.8.tar.gz/auquan_toolbox-2.0.8/backtester/init.py", line 1, in from backtester.dataSource import * File "/private/var/folders/wb/7q8jsy0d29795q825mdg8n6c0000gn/T/tmpPeWuv0conda_skeleton_auquan_toolbox-2.0.8.tar.gz/auquan_toolbox-2.0.8/backtester/dataSource/auquan_data_source.py", line 7, in from backtester.dataSource.data_source_utils import groupAndSortByTimeUpdates File "/private/var/folders/wb/7q8jsy0d29795q825mdg8n6c0000gn/T/tmpPeWuv0conda_skeleton_auquan_toolbox-2.0.8.tar.gz/auquan_toolbox-2.0.8/backtester/dataSource/data_source_utils.py", line 7, in import requests ImportError: No module named requests $PYTHONPATH = /var/folders/wb/7q8jsy0d29795q825mdg8n6c0000gn/T/tmpPeWuv0conda_skeleton_auquan_toolbox-2.0.8.tar.gz/auquan_toolbox-2.0.8

Leaving build/test directories: Work: /Users/kanavarora/anaconda/conda-bld/skeleton_1511357119672/work Test: /Users/kanavarora/anaconda/conda-bld/skeleton_1511357119672/test_tmp Leaving build/test environments: Test: source activate /Users/kanavarora/anaconda/conda-bld/skeleton_1511357119672/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_place Build: source activate /Users/kanavarora/anaconda/conda-bld/skeleton_1511357119672/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol

Error: command failed: /Users/kanavarora/anaconda/conda-bld/skeleton_1511357119672/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/bin/python setup.py install

chandinijain commented 6 years ago

output of conda info

Current conda install:

           platform : osx-64
      conda version : 4.3.30
   conda is private : False
  conda-env version : 4.3.30
conda-build version : 3.0.30
     python version : 2.7.12.final.0
   requests version : 2.18.4
   root environment : /Users/kanavarora/anaconda  (writable)
default environment : /Users/kanavarora/anaconda
   envs directories : /Users/kanavarora/anaconda/envs
                      /Users/kanavarora/.conda/envs
      package cache : /Users/kanavarora/anaconda/pkgs
                      /Users/kanavarora/.conda/pkgs
       channel URLs : https://repo.continuum.io/pkgs/main/osx-64
                      https://repo.continuum.io/pkgs/main/noarch
                      https://repo.continuum.io/pkgs/free/osx-64
                      https://repo.continuum.io/pkgs/free/noarch
                      https://repo.continuum.io/pkgs/r/osx-64
                      https://repo.continuum.io/pkgs/r/noarch
                      https://repo.continuum.io/pkgs/pro/osx-64
                      https://repo.continuum.io/pkgs/pro/noarch
                      http://conda.binstar.org/kanavarora/osx-64
                      http://conda.binstar.org/kanavarora/noarch
        config file : /Users/kanavarora/.condarc
         netrc file : /Users/kanavarora/.netrc
       offline mode : False
         user-agent : conda/4.3.30 requests/2.18.4 CPython/2.7.12 Darwin/15.2.0 OSX/10.11.2    
            UID:GID : 501:20
msarahan commented 6 years ago

You need to use this argument to conda skeleton pypi:

--extra-specs EXTRA_SPECS Extra specs for the build environment to extract the skeleton.

This is because the auquan_toolbox package is written badly and imports lots of other things when running setup.py, as opposed to when it actually runs the software. This is a common mistake that developers make when dealing with the __version__ of a package.

You may need to pass it more than once for more than one missing dependency. I did a few, but there are still more missing that you'll need to follow.

conda skeleton pypi auquan_toolbox --extra-specs requests --extra-specs pandas --extra-specs pandas-datareadern --extra-specs beautifulsoup4

github-actions[bot] commented 2 years ago

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!