conda / conda-build

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

Cannot install tweepy package from pip #280

Closed robertlayton closed 6 years ago

robertlayton commented 9 years ago

Hi, I'm having a problem installing tweepy from conda-buildpip on osx.

$conda-pipbuild tweepy
Password:
Fetching package metadata: ..
Creating standard recipe for tweepy-3.1.0
b'Using url https://pypi.python.org/packages/source/t/tweepy/tweepy-3.1.0.tar.gz (23 KB) for tweepy.\nDownloading tweepy (use --no-download to skip this step)\nUsing cached download\nUnpacking tweepy...\ndone\nworking in /tmp/tmpoh1t8redconda_skeleton_tweepy\nFetching package metadata: ...\nSolving package specifications: .patching file core.py\nHunk #1 succeeded at 168 with fuzz 2 (offset 1 line).\nTraceback (most recent call last):\n  File "setup.py", line 5, in <module>\n    from pip.req import parse_requirements\nImportError: No module named \'pip\'\n\nApplying patch: \'/tmp/tmpoh1t8redconda_skeleton_tweepy/pypi-distutils.patch\'\n$PYTHONPATH = /tmp/tmpoh1t8redconda_skeleton_tweepy/tweepy-3.1.0\nError: command failed: /Users/bob/anaconda/envs/_build/bin/python setup.py install\n'
conda create -n _pipbuild_ --yes python pip
Error: prefix already exists: /Users/bob/anaconda/envs/_pipbuild_
/Users/bob/anaconda/envs/_pipbuild_/bin/pip install tweepy==3.1.0
Requirement already satisfied (use --upgrade to upgrade): tweepy==3.1.0 in ./anaconda/envs/_pipbuild_/lib/python3.4/site-packages
Cleaning up...
Getting dependencies...
  File "__tmpfile__.py", line 3
    print [(req.key, req.specs) for req in reqs]
                                  ^
SyntaxError: invalid syntax
An unexpected error has occurred, please consider sending the
following traceback to the conda GitHub issue tracker at:

    https://github.com/conda/conda-build/issues

Include the output of the command 'conda info' in your report.

Traceback (most recent call last):
  File "/Users/bob/anaconda/lib/python3.4/site-packages/conda_build/main_pipbuild.py", line 156, in build_recipe
    result = subprocess.check_output(args, stderr=subprocess.STDOUT)
  File "/Users/bob/anaconda/lib/python3.4/subprocess.py", line 620, in check_output
    raise CalledProcessError(retcode, process.args, output=output)
subprocess.CalledProcessError: Command '['conda', 'skeleton', 'pypi', 'tweepy', '--version', '3.1.0', '--no-prompt']' returned non-zero exit status 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/bob/anaconda/lib/python3.4/site-packages/conda_build/main_pipbuild.py", line 300, in build_package
    directory = build_recipe(package, version=version)
  File "/Users/bob/anaconda/lib/python3.4/site-packages/conda_build/main_pipbuild.py", line 159, in build_recipe
    raise RuntimeError((" ".join(args)))
RuntimeError: conda skeleton pypi tweepy --version 3.1.0 --no-prompt

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/bob/anaconda/bin/conda-pipbuild", line 5, in <module>
    sys.exit(main())
  File "/Users/bob/anaconda/lib/python3.4/site-packages/conda_build/main_pipbuild.py", line 77, in main
    args_func(args, p)
  File "/Users/bob/anaconda/lib/python3.4/site-packages/conda_build/main_build.py", line 308, in args_func
    args.func(args, p)
  File "/Users/bob/anaconda/lib/python3.4/site-packages/conda_build/main_pipbuild.py", line 350, in execute
    build_package(package, version)
  File "/Users/bob/anaconda/lib/python3.4/site-packages/conda_build/main_pipbuild.py", line 303, in build_package
    directory, dependencies = make_recipe(package, version)
  File "/Users/bob/anaconda/lib/python3.4/site-packages/conda_build/main_pipbuild.py", line 245, in make_recipe
    depends = get_all_dependencies(package, version)
  File "/Users/bob/anaconda/lib/python3.4/site-packages/conda_build/main_pipbuild.py", line 225, in get_all_dependencies
    output = subprocess.check_output(cmd3args)
  File "/Users/bob/anaconda/lib/python3.4/subprocess.py", line 620, in check_output
    raise CalledProcessError(retcode, process.args, output=output)
subprocess.CalledProcessError: Command '['/Users/bob/anaconda/envs/_pipbuild_/bin/python', '__tmpfile__.py']' returned non-zero exit status 1

Despite this saying that tweepy is already installed, (I had previously tried with just pip3) it won't import. It also does the same error if I uninstall tweepy and try the same command. It requests my conda info, so here is is:

$ conda info
Current conda install:

             platform : osx-64
        conda version : 3.7.3
  conda-build version : 1.8.2
       python version : 3.4.2.final.0
     requests version : 2.4.3
     root environment : /Users/bob/anaconda  (writable)
  default environment : /Users/bob/anaconda
     envs directories : /Users/bob/anaconda/envs
        package cache : /Users/bob/anaconda/pkgs
         channel URLs : http://repo.continuum.io/pkgs/free/osx-64/
                        http://repo.continuum.io/pkgs/pro/osx-64/
          config file : None
    is foreign system : False
Aerlinger commented 9 years ago

Also having this issue under similar circumstances and haven't found a solution.

ericmjl commented 9 years ago

Might it be a Python 3 syntax issue? I noticed that the print command does not have parentheses.

jakirkham commented 8 years ago

Agreed, this looks like tweepy issue with Python 3. Try retesting to see if it works with Python 2.

msarahan commented 6 years ago

pipbuild no longer exists. You need to do (at least) 2 steps now:

  1. conda skeleton pypi (package name)
  2. try building with conda build (package name)
  3. troubleshoot as necessary, or if it worked, great, go use your package
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!