3

I have an Anaconda (newest version) environment with Python 3.7.5 installed, it is my only environment so far. Now I want to install glumpy, which is not listed in the anaconda cloud and channels, but it is cloneable via GitHub und installable via pip.
I even have a pre-built wheel lying around, still with the newest version.

Now, since I only use the conda environment and no other Python installation, I would very much like to get it to work there, without introducing some long-term bugs or clutters. What is the best way to do this? AFAIK, pip should never be used within a conda env.

Thanks in advance and I can provide you with console readouts and whatnot in the morning.

JaG

Edit 3:

I have created another env to try this in and I installed m2-patch, but it still does not work. Everything works without a catch until:

...
Applying patch: 'C:\\Users\\TheBeast\\AppData\\Local\\Temp\\tmpnv0lrqd3conda_skeleton_glumpy-1.1.0.tar.gz\\pypi-distutils.patch'
Trying to apply patch as-is
INFO:conda_build.source:Trying to apply patch as-is
INFO conda_build.source:apply_patch(596): Trying to apply patch as-is
(Stripping trailing CRs from patch; use --binary to disable.)
patching file core.py
Hunk #1 succeeded at 167 with fuzz 2 (offset 1 line).
Traceback (most recent call last):
  File "setup.py", line 9, in <module>
    from Cython.Distutils import build_ext
ModuleNotFoundError: No module named 'Cython'
$PYTHONPATH = C:\Users\TheBeast\AppData\Local\Temp\tmpnv0lrqd3conda_skeleton_glumpy-1.1.0.tar.gz\glumpy-1.1.0

Leaving build/test directories:
  Work:
 E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\conda-bld\skeleton_1579203255690\work
  Test:
 E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\conda-bld\skeleton_1579203255690\test_tmp
Leaving build/test environments:
  Test:
source activate  E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\conda-bld\skeleton_1579203255690\_test_env
  Build:
source activate  E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\conda-bld\skeleton_1579203255690\_build_env


Error: command failed: E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\conda-bld\skeleton_1579203255690\_h_env\python.exe setup.py install

I do have cython installed tho. So any thoughts?



Edit: Oh and I forgot to mention that I did already tried

conda skeleton pypi glumpy

But it gave me this error message. And simply installing patch via conda doesn't help alone.

Warning, the following versions were found for glumpy
0.2.0
0.2.1
1.0
1.0.1
1.0.2
1.0.3
1.0.4
1.0.5
1.0.6
1.1.0
Using 1.1.0
Use --version to specify a different version.
Using url https://files.pythonhosted.org/packages/1e/d9/cbc85887ec54406ffe991d42de11445e5dacd052748cf376be6403b40d61/glumpy-1.1.0.tar.gz (492 KB) for glumpy.
Downloading glumpy
PyPI URL:  https://files.pythonhosted.org/packages/1e/d9/cbc85887ec54406ffe991d42de11445e5dacd052748cf376be6403b40d61/glumpy-1.1.0.tar.gz
Using cached download
Unpacking glumpy...
done
working in C:\Users\User\AppData\Local\Temp\tmpn1zgjyc_conda_skeleton_glumpy-1.1.0.tar.gz
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... done

## Package Plan ##

  environment location: E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\conda-bld\skeleton_1578698077181\_h_env


The following NEW packages will be INSTALLED:

    blas:            1.0-mkl
    ca-certificates: 2019.11.27-0
    certifi:         2019.11.28-py37_0
    icc_rt:          2019.0.0-h0cc432a_1
    intel-openmp:    2019.4-245
    mkl:             2019.4-245
    mkl-service:     2.3.0-py37hb782905_0
    mkl_fft:         1.0.15-py37h14836fe_0
    mkl_random:      1.1.0-py37h675688f_0
    numpy:           1.17.4-py37h4320e6b_0
    numpy-base:      1.17.4-py37hc3f5095_0
    openssl:         1.1.1d-he774522_3
    pip:             19.3.1-py37_0
    python:          3.7.6-h60c2a47_2
    pyyaml:          5.2-py37he774522_0
    setuptools:      44.0.0-py37_0
    six:             1.13.0-py37_0
    sqlite:          3.30.1-he774522_0
    vc:              14.1-h0510ff6_4
    vs2015_runtime:  14.16.27012-hf0eaf9b_1
    wheel:           0.33.6-py37_0
    wincertstore:    0.2-py37_0
    yaml:            0.1.7-hc54c509_2

Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... done
Applying patch: 'C:\\Users\\User\\AppData\\Local\\Temp\\tmpn1zgjyc_conda_skeleton_glumpy-1.1.0.tar.gz\\pypi-distutils.patch'

Leaving build/test directories:
  Work:
 E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\conda-bld\skeleton_1578698077181\work
  Test:
 E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\conda-bld\skeleton_1578698077181\test_tmp
Leaving build/test environments:
  Test:
source activate  E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\conda-bld\skeleton_1578698077181\_test_env
  Build:
source activate  E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\conda-bld\skeleton_1578698077181\_build_env


        Error:
            Cannot use 'git' (not a git repo and/or patch) and did not find 'patch' in: E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\conda-bld\skeleton_1578698077181\_build_env\Scripts;E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\conda-bld\skeleton_1578698077181\_build_env\Library\mingw-w64\bin;E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\conda-bld\skeleton_1578698077181\_build_env\Library\usr\bin;E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\conda-bld\skeleton_1578698077181\_build_env\Library\bin;E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\Scripts;E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\Library\mingw-w64\bin;E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\Library\usr\bin;E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\Library\bin;E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\lib\site-packages\pywin32_system32;E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\lib\site-packages\pywin32_system32;E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3;E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\Library\mingw-w64\bin;E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\Library\usr\bin;E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\Library\bin;E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\Scripts;E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\bin;E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3;E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\Library\mingw-w64\bin;E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\Library\usr\bin;E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\Library\bin;E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\Scripts;E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\bin;E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\lib\site-packages\pywin32_system32;E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3;E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\Library\mingw-w64\bin;E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\Library\usr\bin;E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\Library\bin;E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\Scripts;E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\bin;E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\condabin;E:\User\Programme\Multimedia\ImageMagick-7.0.9-Q16;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;E:\User\Programme\Utility_Misc\putty;E:\Allgemein\Allgemein\Programme\Sicherheit\ATI.ACE\Core-Static;E:\Allgemein\Allgemein\Programme\Programmieren\cygwin64\bin;C:\Programme\Java\jre1.8.0_144\bin;C:\WINDOWS\System32\OpenSSH;E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda\Scripts\jupyter.exe;E:\Allgemein\Allgemein\Programme\Programmieren\Git LFS;E:\Allgemein\Allgemein\Programme\Programmieren\CMake\bin;E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda\Library\mingw-w64\bin;E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda\Library\bin;C:\Program Files (x86)\Wolfram Research\WolframScript;E:\Allgemein\Allgemein\Programme\Programmieren\Git\cmd;C:\Users\User\AppData\Local\Microsoft\WindowsApps;C:\Users\User\AppData\Local\GitHubDesktop\bin;C:\Users\User\AppData\Local\atom\bin;E:\User\Programme\Development\PyCharm2019.2\bin;.;C:\Users\User\spicetify-cli
            You can install 'patch' using apt-get, yum (Linux), Xcode (MacOSX),
            or conda, m2-patch (Windows),

As pointed out in the comments, using conda skeleton pypi --extra-specs patch glumpy might help, but then it throws this exception, which says that it can't find patch:

Using url https://files.pythonhosted.org/packages/1e/d9/cbc85887ec54406ffe991d42de11445e5dacd052748cf376be6403b40d61/glumpy-1.1.0.tar.gz (492 KB) for glumpy.
Downloading glumpy
PyPI URL:  https://files.pythonhosted.org/packages/1e/d9/cbc85887ec54406ffe991d42de11445e5dacd052748cf376be6403b40d61/glumpy-1.1.0.tar.gz
Using cached download
Unpacking glumpy...
done
working in C:\Users\User\AppData\Local\Temp\tmp0dakggadconda_skeleton_glumpy-1.1.0.tar.gz
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... failed

Leaving build/test directories:
  Work:
 E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\conda-bld\skeleton_1578745194043\work
  Test:
 E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\conda-bld\skeleton_1578745194043\test_tmp
Leaving build/test environments:
  Test:
source activate  E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\conda-bld\skeleton_1578745194043\_test_env
  Build:
source activate  E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\conda-bld\skeleton_1578745194043\_build_env


Traceback (most recent call last):
  File "E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\lib\site-packages\conda_build\environ.py", line 757, in get_install_actions
    actions = install_actions(prefix, index, specs, force=True)
  File "E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\lib\site-packages\conda\common\io.py", line 88, in decorated
    return f(*args, **kwds)
  File "E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\lib\site-packages\conda\plan.py", line 474, in install_actions
    txn = solver.solve_for_transaction(prune=prune, ignore_pinned=not pinned)
  File "E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\lib\site-packages\conda\core\solve.py", line 117, in solve_for_transaction
    should_retry_solve)
  File "E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\lib\site-packages\conda\core\solve.py", line 158, in solve_for_diff
    force_remove, should_retry_solve)
  File "E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\lib\site-packages\conda\core\solve.py", line 275, in solve_final_state
    ssc = self._add_specs(ssc)
  File "E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\lib\site-packages\conda\core\solve.py", line 555, in _add_specs
    explicit_pool = ssc.r._get_package_pool(self.specs_to_add)
  File "E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\lib\site-packages\conda\resolve.py", line 531, in _get_package_pool
    pool = self.get_reduced_index(specs)
  File "E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\lib\site-packages\conda\common\io.py", line 88, in decorated
    return f(*args, **kwds)
  File "E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\lib\site-packages\conda\resolve.py", line 552, in get_reduced_index
    explicit_specs, features = self.verify_specs(explicit_specs)
  File "E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\lib\site-packages\conda\resolve.py", line 288, in verify_specs
    raise ResolvePackageNotFound(bad_deps)
conda.exceptions.ResolvePackageNotFound:
  - patch

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\Scripts\conda-skeleton-script.py", line 10, in <module>
    sys.exit(main())
  File "E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\lib\site-packages\conda_build\cli\main_skeleton.py", line 65, in main
    return execute(sys.argv[1:])
  File "E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\lib\site-packages\conda_build\cli\main_skeleton.py", line 61, in execute
    version=args.version, config=config)
  File "E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\lib\site-packages\conda_build\api.py", line 290, in skeletonize
    recursive=recursive, config=config, **kwargs)
  File "E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\lib\site-packages\conda_build\skeletons\pypi.py", line 319, in skeletonize
    setup_options=setup_options)
  File "E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\lib\site-packages\conda_build\skeletons\pypi.py", line 726, in get_package_metadata
    config=config)
  File "E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\lib\site-packages\conda_build\skeletons\pypi.py", line 1127, in get_pkginfo
    setup_options=setup_options)
  File "E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\lib\site-packages\conda_build\skeletons\pypi.py", line 1164, in run_setuppy
    subdir=config.host_subdir, clear_cache=False, config=config)
  File "E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\lib\site-packages\conda_build\environ.py", line 850, in create_env
    channel_urls=tuple(config.channel_urls))
  File "E:\Allgemein\Allgemein\Programme\Programmieren\Anaconda3\lib\site-packages\conda_build\environ.py", line 759, in get_install_actions
    raise DependencyNeedsBuildingError(exc, subdir=subdir)
conda_build.exceptions.DependencyNeedsBuildingError: Unsatisfiable dependencies for platform win-64: {'patch'}
JustAGuy
  • 129
  • 1
  • 11
  • _I have an Anaconda (newest version) environment with Python 3.7.5 installed, it is my only environment so far._ I’m confused, you’re only using a single environment for all your projects etc.? Also, did you follow the advice to install ‘patch’? – AMC Jan 11 '20 at 02:43
  • Try using the `--extra-specs` argument to specify that the temporary environment should have `patch` installed, i.e., `conda skeleton pypi --extra-specs patch glumpy`. And/or include `git` in there as well. Also, props for resisting the urge to `pip install`! It definitely can be dangerous to use `pip` in the **base** env. Another alternative is for you to install Miniconda and then create an Anaconda env as a non-**base** env. – merv Jan 11 '20 at 03:32
  • @AMC Well I currently only really have one project and all the dependencies were already in base, so I don't have to create specialized envs. I am also not really planning on publishing it, so I can just use the newest stable versions everywhere and not really care about specific version configurations. Why would it then be weird? Should I just be using python+pip? – JustAGuy Jan 11 '20 at 12:23
  • @merv It then throws another exception (or actually two exeptions), edited the question because the stacktrace is too long. – JustAGuy Jan 11 '20 at 12:25
  • There is no "never use pip with conda" directive. Even Anaconda weighs in on this. Their page https://www.anaconda.com/using-pip-in-a-conda-environment/ has some strategies you can use to combine Conda and Pip. My view, unless you want to put your project aside and help make whatever package you need available in Conda for all, use Conda and Pip and move on. Particularly if you aren't going to distribute your personal project. – Jason Woods Jan 11 '20 at 13:02
  • 1
    @JayWoods those official recommendations also clearly discourage switching back and forth between `conda` and `pip`, which can't be avoided if the user only has an Anaconda **base** env. If one wants to use `pip`, then other envs need to be used. – merv Jan 11 '20 at 13:26
  • 1
    @JayWoods I could create another environment, I don't think it would hurt a lot, I just would want to be able to start all applications etc. in said environment so that I can develop normally without explicitly having to switch and activate every time I open an application. If creating a secondary env would solve the problem I would be willing to do so, I just don't understand 1. why do I have to have something besides base and 2. how do I automate activation then? – JustAGuy Jan 11 '20 at 14:29
  • 1
    @JustAGuy _why do I have to have something besides base_ Using only the base environment for everything defeats the point of using virtual environments in the first place. – AMC Jan 11 '20 at 18:17
  • @AMC Well, yeah, but I wanted to have a good package manager and everywhere all packages (like numpy, numby, matplotlib, etc.) suggest using Anaconda to install them... So I did. – JustAGuy Jan 11 '20 at 20:34
  • @JustAGuy I’m not sure I understand how that addresses my comment. – AMC Jan 11 '20 at 21:39
  • @AMC I am using Anaconda not because of its virtualenv feature, but because of conda and the ease of use and accessibility of scientific packages. If anyone can point out why and how to use other environments (with said restrictions) I would of course use them. But since I am only in need of conda really, doing everything in base. – JustAGuy Jan 12 '20 at 20:09
  • @JustAGuy _I am using Anaconda not because of its virtualenv feature_ What virtualenv feature? _but because of conda and the ease of use and accessibility of scientific packages_ Conda has two main functions, though. – AMC Jan 12 '20 at 20:14
  • I didn’t suggest you use a different **tool** for virtual environments, I meant you should use other **Conda environments**. – AMC Jan 12 '20 at 20:15
  • @AMC So the solution to my problem would be to just add an env `dev` and do everything in there? Would that not be the same as using base? – JustAGuy Jan 12 '20 at 20:46
  • @JustAGuy The ideal/proper thing would be to use a **separate** environment for each **separate project**. – AMC Jan 12 '20 at 20:58
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/205841/discussion-between-amc-and-justaguy). – AMC Jan 12 '20 at 20:58

0 Answers0