Can't build wheel and single-version-externally-managed not recognized error on pip install pythonnet WSL 2 VS Code - python-wheel

I am on WSL2 in VS Code. Using Zsh on VS Code.
I am trying to install pythonnet though am getting two errors:
ERROR: Failed building wheel for pythonnet
error: option --single-version-externally-managed not recognized
This is from using pip install pythonnet==2.5.2
My versions are:
Python 3.8.10
Wheel 0.37.0
Mono: 6.8.0.105
pycparser 2.20
I have searched high and low online though I can't find a solution - everything seems to point to updating wheel and installing mono - as you can see from the above version numbers, I have them installed.
I am doing everything from within a virtual env.
Does anyone have any experience with this or know what to do to get past these errors?
Full log:
 ~/j/s/stx1alpha-signals/d/backend on   master !6 ?1 ❯ pip install
pythonnet==2.5.2 
stx1alpha at  10:52:05 AM Collecting pythonnet==2.5.2 Using cached
pythonnet-2.5.2.tar.gz (1.9 MB) Preparing metadata (setup.py) ...
done Requirement already satisfied: pycparser in
/home/jessica-ryan/jessica-ryan/stx1alpha/.venv/lib/python3.8/site-packages
(from pythonnet==2.5.2) (2.20) Building wheels for collected packages:
pythonnet Building wheel for pythonnet (setup.py) ... error ERROR:
Command errored out with exit status 1: command:
/home/jessica-ryan/jessica-ryan/stx1alpha/.venv/bin/python -u -c
'import io, os, sys, setuptools, tokenize; sys.argv[0] =
'"'"'/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/setup.py'"'"';
file='"'"'/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/setup.py'"'"';f
= getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import
setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"',
'"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))'
bdist_wheel -d /tmp/pip-wheel-789kx5l4
cwd: /tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/
Complete output (153 lines): running bdist_wheel running build
running build_ext Checking for updates from
https://www.nuget.org/api/v2/. Currently running NuGet.exe 4.1.0.
Updating NuGet.exe to 5.11.0. Update successful. MSBuild
auto-detection: using msbuild version '14.0' from
'/usr/lib/mono/xbuild/14.0/bin'.
xbuild tool is deprecated and will be removed in future updates, use msbuild instead <<<<
MSBUILD: error MSBUILD0004: Too many project files specified
WARNING: Error reading msbuild project information, ensure that your input solution or project file is valid. NETCore and UAP projects
will be skipped, only packages.config files will be restored.
Restoring NuGet package System.ValueTuple.4.5.0. Restoring NuGet
package NUnit.ConsoleRunner.3.11.1. Restoring NuGet package
NUnit.3.12.0. Restoring NuGet package UnmanagedExports.1.2.7.
Adding package 'NUnit.3.12.0' to folder
'/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/packages' Adding package 'System.ValueTuple.4.5.0' to folder
'/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/packages' Adding package 'UnmanagedExports.1.2.7' to folder
'/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/packages' Adding package 'NUnit.ConsoleRunner.3.11.1' to folder
'/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/packages' Added package 'UnmanagedExports.1.2.7' to folder
'/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/packages' Added package 'System.ValueTuple.4.5.0' to folder
'/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/packages' Added package 'NUnit.ConsoleRunner.3.11.1' to folder
'/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/packages' Added package 'NUnit.3.12.0' to folder
'/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/packages'
NuGet Config files used:
/home/jessica-ryan/.config/NuGet/NuGet.Config
Feeds used:
/home/jessica-ryan/.nuget/packages/
https://api.nuget.org/v3/index.json
Installed:
4 package(s) to packages.config projects
xbuild tool is deprecated and will be removed in future updates, use msbuild instead <<<<
XBuild Engine Version 14.0 Mono, Version 6.8.0.105 Copyright (C) 2005-2013 Various Mono authors
Build started 11/18/2021 10:53:28. __________________________________________________ Project "/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/pythonnet.sln"
(Clean target(s)):
Target ValidateSolutionConfiguration:
Building solution configuration "ReleaseMono|x64".
Target Clean:
Project "/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/src/runtime/Python.Runtime.csproj"
(Clean target(s)):
Target CoreClean:
Deleting file '/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/src/runtime/obj/x64/ReleaseMono/.NETFramework,Version=v4.0.AssemblyAttribute.cs'
Done building project "/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/src/runtime/Python.Runtime.csproj".
The project 'clrmodule' is disabled for solution configuration 'ReleaseMono|x64'.
Project "/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/src/testing/Python.Test.csproj"
(Clean target(s)):
Target CoreClean:
Deleting file '/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/src/testing/obj/x64/ReleaseMono/.NETFramework,Version=v4.0.AssemblyAttribute.cs'
Done building project "/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/src/testing/Python.Test.csproj".
Project "/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/src/embed_tests/Python.EmbeddingTest.csproj"
(Clean target(s)):
Target CoreClean:
Deleting file '/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/src/embed_tests/obj/x64/ReleaseMono/.NETFramework,Version=v4.0.AssemblyAttribute.cs'
Done building project "/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/src/embed_tests/Python.EmbeddingTest.csproj".
Project "/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/src/console/Console.csproj"
(Clean target(s)):
Target CoreClean:
Deleting file '/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/src/console/obj/x64/ReleaseMono/.NETFramework,Version=v4.0.AssemblyAttribute.cs'
Done building project "/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/src/console/Console.csproj".
Done building project
"/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/pythonnet.sln".
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:00.3407830
xbuild tool is deprecated and will be removed in future updates, use msbuild instead <<<<
XBuild Engine Version 14.0 Mono, Version 6.8.0.105 Copyright (C) 2005-2013 Various Mono authors
Build started 11/18/2021 10:53:29. __________________________________________________ Project "/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/pythonnet.sln"
(Build target(s)):
Target ValidateSolutionConfiguration:
Building solution configuration "ReleaseMono|x64".
Target Build:
Project "/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/src/runtime/Python.Runtime.csproj"
(default target(s)):
Target PrepareForBuild:
Configuration: ReleaseMono Platform: x64
Created directory "bin/"
Target GenerateSatelliteAssemblies:
No input files were specified for target GenerateSatelliteAssemblies, skipping.
Target CoreCompile:
Tool /usr/lib/mono/4.5/mcs.exe execution started with arguments: /noconfig /debug:pdbonly /optimize+
/out:obj/x64/ReleaseMono/Python.Runtime.dll
/resource:obj/x64/ReleaseMono/Python.Runtime.resources.clr.py,clr.py
Codecs/EncoderGroup.cs Codecs/DecoderGroup.cs
Codecs/RawProxyEncoder.cs Codecs/TupleCodecs.cs converterextensions.cs
finalizer.cs Properties/AssemblyInfo.cs ../SharedAssemblyInfo.cs
arrayobject.cs assemblymanager.cs BorrowedReference.cs classderived.cs
classbase.cs classmanager.cs classobject.cs clrobject.cs
codegenerator.cs constructorbinder.cs constructorbinding.cs
converter.cs CustomMarshaler.cs debughelper.cs delegatemanager.cs
delegateobject.cs eventbinding.cs eventobject.cs exceptions.cs
extensiontype.cs fieldobject.cs generictype.cs genericutil.cs
importhook.cs indexer.cs interfaceobject.cs interfaces.cs interop.cs
iterator.cs managedtype.cs metatype.cs methodbinder.cs
methodbinding.cs methodobject.cs methodwrapper.cs
modulefunctionobject.cs moduleobject.cs modulepropertyobject.cs
nativecall.cs NewReference.cs NonCopyableAttribute.cs overload.cs
propertyobject.cs pyansistring.cs pydict.cs PyExportAttribute.cs
pyfloat.cs pyint.cs pyiter.cs pylist.cs pylong.cs pynumber.cs
pyobject.cs pyscope.cs pysequence.cs pystring.cs pythonengine.cs
pythonexception.cs pytuple.cs ReferenceExtensions.cs runtime.cs
typemanager.cs typemethod.cs Util.cs platform/Types.cs
platform/LibraryLoader.cs polyfill/ReflectionPolifills.cs
slots/mp_length.cs interop38.cs
obj/x64/ReleaseMono/.NETFramework,Version=v4.0.AssemblyAttribute.cs
/target:library /unsafe+
/define:"PYTHON38;PYTHON3;UCS4;MONO_LINUX;PYTHON_WITHOUT_ENABLE_SHARED"
/nowarn:1591 /doc:bin/Python.Runtime.xml /langversion:7.3 /nostdlib
/reference:/usr/lib/mono/4.0-api/System.dll
/reference:/usr/lib/mono/4.0-api/System.Core.dll
/reference:/usr/lib/mono/4.0-api//mscorlib.dll CSC: error CS1617:
Invalid -langversion option 7.3'. It must be ISO-1', `ISO-2',
Default, Latest or value in range 1 to 7.2
Task "Csc" execution -- FAILED
Done building target "CoreCompile" in project "/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/src/runtime/Python.Runtime.csproj".--
FAILED
Done building project "/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/src/runtime/Python.Runtime.csproj".--
FAILED
Task "MSBuild" execution -- FAILED
Done building target "Build" in project "/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/pythonnet.sln".-- FAILED Done building project
"/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/pythonnet.sln".-- FAILED
Build FAILED. Errors:
/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/pythonnet.sln
(Build) -> (Build target) ->
/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/src/runtime/Python.Runtime.csproj
(default targets) ->
/usr/lib/mono/xbuild/14.0/bin/Microsoft.CSharp.targets (CoreCompile
target) ->
CSC: error CS1617: Invalid -langversion option `7.3'. It must be `ISO-1', `ISO-2', Default, Latest or value in range 1 to 7.2
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.3647620 Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/setup.py",
line 630, in
setup(
File "/home/jessica-ryan/jessica-ryan/stx1alpha/.venv/lib/python3.8/site-packages/setuptools/init.py",
line 153, in setup
return distutils.core.setup(**attrs)
File "/usr/lib/python3.8/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib/python3.8/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/setup.py",
line 612, in run
return bdist_wheel.bdist_wheel.run(self)
File "/home/jessica-ryan/jessica-ryan/stx1alpha/.venv/lib/python3.8/site-packages/wheel/bdist_wheel.py",
line 299, in run
self.run_command('build')
File "/usr/lib/python3.8/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/usr/lib/python3.8/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/usr/lib/python3.8/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/usr/lib/python3.8/distutils/command/build_ext.py", line 340, in run
self.build_extensions()
File "/usr/lib/python3.8/distutils/command/build_ext.py", line 449, in build_extensions
self._build_extensions_serial()
File "/usr/lib/python3.8/distutils/command/build_ext.py", line 474, in _build_extensions_serial
self.build_extension(ext)
File "/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/setup.py",
line 353, in build_extension
subprocess.check_call(" ".join(cmd + ["/t:Build"]), shell=use_shell)
File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command 'xbuild pythonnet.sln
/p:Configuration=ReleaseMono /p:Platform=x64
/p:DefineConstants="PYTHON38%3BPYTHON3%3BUCS4%3BMONO_LINUX%3BPYTHON_WITHOUT_ENABLE_SHARED"
/p:PythonBuildDir="/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/build/lib.linux-x86_64-3.8"
/p:PythonInteropFile="interop38.cs" /p:PackageId=pythonnet_py38_x64
/verbosity:normal /t:Build' returned non-zero exit status 1.
---------------------------------------- ERROR: Failed building wheel for pythonnet Running setup.py clean for pythonnet Failed to
build pythonnet Installing collected packages: pythonnet
Running setup.py install for pythonnet ... error
ERROR: Command errored out with exit status 1:
command: /home/jessica-ryan/jessica-ryan/stx1alpha/.venv/bin/python -u -c
'import io, os, sys, setuptools, tokenize; sys.argv[0] =
'"'"'/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/setup.py'"'"';
file='"'"'/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/setup.py'"'"';f
= getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import
setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"',
'"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))'
install --record /tmp/pip-record-2fxmdkst/install-record.txt
--single-version-externally-managed --compile --install-headers /home/jessica-ryan/jessica-ryan/stx1alpha/.venv/include/site/python3.8/pythonnet
cwd: /tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/
Complete output (6 lines):
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help
error: option --single-version-externally-managed not recognized
---------------------------------------- ERROR: Command errored out with exit status 1:
/home/jessica-ryan/jessica-ryan/stx1alpha/.venv/bin/python -u -c
'import io, os, sys, setuptools, tokenize; sys.argv[0] =
'"'"'/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/setup.py'"'"';
file='"'"'/tmp/pip-install-mlymh9lo/pythonnet_eef24e9bf71f4dcdacdc5897c9504adf/setup.py'"'"';f
= getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import
setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"',
'"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))'
install --record /tmp/pip-record-2fxmdkst/install-record.txt
--single-version-externally-managed --compile --install-headers /home/jessica-ryan/jessica-ryan/stx1alpha/.venv/include/site/python3.8/pythonnet
Check the logs for full command output.

You need a newer version of Mono. The one you have does not support C# 7.3 that Pythonnet build needs.

Related

Error pip installing wheel file from github repository (to download pycocotools)

I am installing Tensorflow (1.15.0) in order to perform some deep learning object detection, but am having trouble pip installing pycocotools. I am following this tutorial, which is an updated tutorial originally from YouTube channel Sentdex. I am also using the Anaconda Prompt for this purpose.
After creating and activating a conda environment and installing all the needed packages (TensorFlow, lxml, etc.), I am trying to run the command pip install pycocotools package, but get the following error:
Building wheels for collected packages: pycocotools
Building wheel for pycocotools (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'C:\anaconda3\envs\object\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\AppData\\Local\\Temp\\pip-install-f_16w712\\pycocotools\\setup.py'"'"'; __file__='"'"'C:\\AppData\\Local\\Temp\\pip-install-f_16w712\\pycocotools\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\AppData\Local\Temp\pip-wheel-au01c73g'
cwd: C:\AppData\Local\Temp\pip-install-f_16w712\pycocotools\
Complete output (16 lines):
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
creating build\lib.win-amd64-3.7\pycocotools
copying pycocotools\coco.py -> build\lib.win-amd64-3.7\pycocotools
copying pycocotools\cocoeval.py -> build\lib.win-amd64-3.7\pycocotools
copying pycocotools\mask.py -> build\lib.win-amd64-3.7\pycocotools
copying pycocotools\__init__.py -> build\lib.win-amd64-3.7\pycocotools
running build_ext
cythoning pycocotools/_mask.pyx to pycocotools\_mask.c
C:\anaconda3\envs\object\lib\site-packages\Cython\Compiler\Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: C:\AppData\Local\Temp\pip-install-f_16w712\pycocotools\pycocotools\_mask.pyx
tree = Parsing.p_module(s, pxd, full_module_name)
building 'pycocotools._mask' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/
----------------------------------------
ERROR: Failed building wheel for pycocotools
Running setup.py clean for pycocotools
Failed to build pycocotools
Installing collected packages: pycocotools
Running setup.py install for pycocotools ... error
ERROR: Command errored out with exit status 1:
command: 'C:\anaconda3\envs\object\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\AppData\\Local\\Temp\\pip-install-f_16w712\\pycocotools\\setup.py'"'"'; __file__='"'"'C:\\AppData\\Local\\Temp\\pip-install-f_16w712\\pycocotools\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\AppData\Local\Temp\pip-record-bjfh6urg\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\anaconda3\envs\object\Include\pycocotools'
cwd: C:\AppData\Local\Temp\pip-install-f_16w712\pycocotools\
Complete output (14 lines):
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
creating build\lib.win-amd64-3.7\pycocotools
copying pycocotools\coco.py -> build\lib.win-amd64-3.7\pycocotools
copying pycocotools\cocoeval.py -> build\lib.win-amd64-3.7\pycocotools
copying pycocotools\mask.py -> build\lib.win-amd64-3.7\pycocotools
copying pycocotools\__init__.py -> build\lib.win-amd64-3.7\pycocotools
running build_ext
skipping 'pycocotools\_mask.c' Cython extension (up-to-date)
building 'pycocotools._mask' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\anaconda3\envs\object\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\AppData\\Local\\Temp\\pip-install-f_16w712\\pycocotools\\setup.py'"'"'; __file__='"'"'C:\\AppData\\Local\\Temp\\pip-install-f_16w712\\pycocotools\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\AppData\Local\Temp\pip-record-bjfh6urg\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\anaconda3\envs\object\Include\pycocotools' Check the logs for full command output.
Apparently, there is a wheel file that needs to be downloaded from this github repository, under the subdirectory PythonAPI. I ran this code to do so:
pip install git+https://github.com/philferriere/cocoapi#egg=pycocotools^subdirectory==PythonAPI
The following error is produced:
Collecting pycocotoolssubdirectory==PythonAPI
Cloning https://github.com/philferriere/cocoapi to c:\appdata\local\temp\pip-install-c_lq0qhi\pycocotoolssubdirectory
ERROR: Command errored out with exit status 1:
command: 'C:\anaconda3\envs\object\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\AppData\\Local\\Temp\\pip-install-c_lq0qhi\\pycocotoolssubdirectory\\setup.py'"'"'; __file__='"'"'C:\\AppData\\Local\\Temp\\pip-install-c_lq0qhi\\pycocotoolssubdirectory\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\AppData\Local\Temp\pip-pip-egg-info-0mcbi3nr'
cwd: C:\AppData\Local\Temp\pip-install-c_lq0qhi\pycocotoolssubdirectory\
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\anaconda3\envs\object\lib\tokenize.py", line 447, in open
buffer = _builtin_open(filename, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\AppData\\Local\\Temp\\pip-install-c_lq0qhi\\pycocotoolssubdirectory\\setup.py'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
How can I successfully install this repository? I need the wheel file so that I can proceed with the pycocotools installation. Note: I have installed the latest version of pip, so that isn't the issue.
Try running it as follows:
pip install pycocotools-windows
as suggested here.

Building TensorFlow 2 with bazel 0.29.1 on Windows 10 fails

Trying to compile TF 2.0 with Bazel, ends up in a failure.
I am struggling this issue for quite a while, looked it up online, but haven't found any solution to the exact problem. Several running configuration (with or w/o Cuda, with or w/o creating zip file, etc) eventually leading to the same failure.
System information:
OS Platform and Distribution (Windows 10)
TensorFlow installed from (source)
TensorFlow version: 2.0 (master branch on 07 Nov 2019, to be exact)
Python version: 3.7
Installed using virtualenv? pip? conda?: No
Bazel version (if compiling from source): 0.29.1
GCC/Compiler version (if compiling from source): 8.1.0
CUDA/cuDNN version: 10.0/7
GPU model and memory: GeForce GTX 1050 15.88 GB RAM
My actions:
1. git checkout master (in the TF git repo)
2. bazel clean
3. configure (all defaults except for python path and Cuda)
4. bazel build --config=cuda --define=no_tensorflow_py_deps=true tensorflow:tensorflow_cc.dll
Failure message:
ERROR: C:/users/shahar/git/tensorflow/tensorflow/core/BUILD:2537:1:
Executing genrule //tensorflow/core:version_info_gen failed (Exit 5)
LAUNCHER ERROR: Cannot launch process: "C:/Program
Files/WindowsApps/PythonSoftwareFoundation.Python.3.7_3.7.1520.0_x64__qbz5n2kfra8p0/python.exe"
C:\users\shahar_bazel_shahar\duchsbgv\execroot\org_tensorflow\bazel-out\x64_windows-opt\bin\tensorflow\tools\git\gen_git_source.zip
--generate external/local_config_git/gen/spec.json external/local_config_git/gen/head
external/local_config_git/gen/branch_ref
bazel-out/x64_windows-opt/bin/tensorflow/core/util/version_info.cc
--git_tag_override= Reason: (error: 5): Access is denied.
What am i doing wrong?
Edit:
added a junction with #László advice:
mklink /j c:\python "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1520.0_x64__qbz5n2kfra8p0"
and used it when "configure" asked me to, for both python.exe and the libs, yet the error remains. details:
ERROR: C:/users/shahar/git/tensorflow/tensorflow/core/BUILD:2537:1:
Executing genrule //tensorflow/core:version_info_gen failed (Exit 5)
LAUNCHER ERROR: Cannot launch process: "C:/python/python.exe"
C:\users\shahar_bazel_shahar\duchsbgv\execroot\org_tensorflow\bazel-out\x64_windows-opt\bin\tensorflow\tools\git\gen_git_source.zip
--generate external/local_config_git/gen/spec.json external/local_config_git/gen/head
external/local_config_git/gen/branch_ref
bazel-out/x64_windows-opt/bin/tensorflow/core/util/version_info.cc
--git_tag_override= Reason: (error: 5): Access is denied.
Edit_2:
Again with #László help:
I ran:
bazel info execution_root
got a path, cd into it.
From there i ran:
c:\python\python.exe c:\users\shahar\_bazel_shahar\duchsbgv\execroot\org_tensorflow\bazel-out\x64_windows-opt\bin\tensorflow\tools\git\gen_git_source.zip --generate external/local_config_git/gen/spec.json external/local_config_git/gen/head external/local_config_git/gen/branch_ref c:\tmp\foo.cc --git_tag_override=
and got the following error message:
Traceback (most recent call last): File
"\?\C:\Users\Shahar\AppData\Local\Temp\Bazel.runfiles_ltu2ig_a\runfiles\org_tensorflow\tensorflow\tools\git\gen_git_source.py",
line 340, in
generate(args.generate, args.git_tag_override) File "\?\C:\Users\Shahar\AppData\Local\Temp\Bazel.runfiles_ltu2ig_a\runfiles\org_tensorflow\tensorflow\tools\git\gen_git_source.py",
line 273, in generate
write_version_info(dest_file, git_version) File "\?\C:\Users\Shahar\AppData\Local\Temp\Bazel.runfiles_ltu2ig_a\runfiles\org_tensorflow\tensorflow\tools\git\gen_git_source.py",
line 228, in write_version_info
open(filename, "w").write(contents) FileNotFoundError: [Errno 2] No such file or directory: 'c:\tmp\foo.cc'
I suspect the space in the Python path.
Try this:
open cmd.exe
create a junction c:\python pointing to the real Python directory:
mklink /j c:\python "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1520.0_x64__qbz5n2kfra8p0"
You can use any other path than c:\python, just make sure there's no space or special characters in it.
run ./configure.py again, use c:\python

Tensorflow 1.9 Bazel build error with Cuda on Windows

I'm trying to compile a sample program which uses Tensorflow core, with CUDA support on Windows 10 64bit via Bazel on the following environments:
Windows 10 64 bit
CUDA Toolkit 9.0
CUDNN 9.0
Tensorflow 1.9
Bazel 0.16
I went through the configure.py successfully, I added the CUDA and the CUDNN location.
This is my Bazel BUILD file:
cc_binary(
name = "mnistpredict.dll",
srcs = ["mnist.cc", "MNIST.h"],
deps = [
"//tensorflow/core:tensorflow",
],
linkshared=1
)
I try to compile with this command:
bazel build //tensorflow/loadgraph:mnistpredict.dll
ERROR:
C:/users/laci/downloads/tensorflow-1.9.0/tensorflow/loadgraph/BUILD:1:1:
error loading package 'tensorflow/core': Encountered error while
reading extension file 'cuda/build_defs.bzl': no such package
'#local_config_cuda//cuda': Traceback (most recent call last):
File "C:/users/laci/downloads/tensorflow-1.9.0/third_party/gpus/cuda_configure.bzl",
line 1166
_create_local_cuda_repository(repository_ctx)
File "C:/users/laci/downloads/tensorflow-1.9.0/third_party/gpus/cuda_configure.bzl",
line 995, in _create_local_cuda_repository
_get_cuda_config(repository_ctx)
File "C:/users/laci/downloads/tensorflow-1.9.0/third_party/gpus/cuda_configure.bzl",
line 750, in _get_cuda_config
_cudnn_version(repository_ctx, cudnn_install_base..., ...)
File "C:/users/laci/downloads/tensorflow-1.9.0/third_party/gpus/cuda_configure.bzl",
line 466, in _cudnn_version
find_cuda_define(repository_ctx, cudnn_header_dir, "c...", ...)
File "C:/users/laci/downloads/tensorflow-1.9.0/third_party/gpus/cuda_configure.bzl",
line 422, in find_cuda_define
auto_configure_fail(("Error reading %s: %s" % (str(h...)))
File "C:/users/laci/downloads/tensorflow-1.9.0/third_party/gpus/cuda_configure.bzl",
line 210, in auto_configure_fail
fail(("\n%sCuda Configuration Error:%...)))
Cuda Configuration Error: Error reading
C:/Users/laci/Downloads/cudnn-9.0-windows10-x64-v7.1/cuda/include/cudnn.h:
java.io.IOException: ERROR:
src/main/native/windows/processes-jni.cc(239): CreateProcessW("grep"
--color=never -A1 -E "#define CUDNN_MAJOR" C:/Users/laci/Downloads/cudnn-9.0-windows10-x64-v7.1/cuda/include/cudnn.h):
The system cannot find the file specified.
and referenced by '//tensorflow/loadgraph:mnistpredict.dll' ERROR:
Analysis of target '//tensorflow/loadgraph:mnistpredict.dll' failed;
build aborted: Analysis failed INFO: Elapsed time: 1.612s INFO: 0
processes. FAILED: Build did NOT complete successfully (2 packages
loaded)
currently loading: tensorflow/core
When I try it without CUDA support, I can compile it successfully.
It was looking for grep.exe under %PATH% but failed. Either adding Git\bin to %PATH% or install grep for Windows will do the trick.
It had taken me several days to finally build a tensorflow-gpu 1.10 whl on Windows 7 64 bit with bazel + msys2.

Buildroot - installing of the "pytest-runner" package fails

Buildroot version: 2017-02
I need to integrate python package 'chardet' to my build. The chardet require the 'pytest-runner'package.
Case 1
The 'chardet' is marked to be integrated into build. The 'pytest-runner' is not pre-feteched and the 'chardet' package updated to the latest version (3.0.3) before the build with the scanpypi script. When the make is run the following error message is shown indicating problems with the 'pytest-runner':
>>> python-chardet 3.0.3 Building
(cd /home/nnnn/bldr_lab/buildroot/output/build/python-chardet-3.0.3//;
PATH="/home/nnnn/bldr_lab/buildroot/output/host/bin:/home/nnnn/bldr_lab
/buildroot/output/host/sbin:/home/nnnn/bldr_lab/buildroot/output/host/usr
/bin:/home/nnnn/bldr_lab/buildroot/output/host/usr/sbin:/home/nnnn/x-tools
/arm-cortex_a8-linux-gnueabihf/bin:/home/nnnn/bin:/home/nnnn/.local
/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr
/games:/usr/local/games" PYTHONPATH="/home/nnnn/bldr_lab/buildroot/output
/target/usr/lib/python2.7/sysconfigdata/:/home/nnnn/bldr_lab/buildroot
/output/target/usr/lib/python2.7/site-packages/" _python_sysroot=/home
/nnnn/bldr_lab/buildroot/output/host/usr/arm-buildroot-linux-gnueabihf
/sysroot _python_prefix=/usr _python_exec_prefix=/usr /home/nnnn/bldr_lab
/buildroot/output/host/usr/bin/python setup.py build )
Download error on https://pypi.python.org/simple/pytest-runner/: unknown
url type: https -- Some packages may not be found!
Couldn't find index page for 'pytest-runner' (maybe misspelled?)
Download error on https://pypi.python.org/simple/: unknown url type: https
-- Some packages may not be found!
No local packages or download links found for pytest-runner
Traceback (most recent call last):
File "setup.py", line 52, in <module>
['chardetect = chardet.cli.chardetect:main']})
File "/home/nnnn/bldr_lab/buildroot/output/host/usr/lib/python2.7
/distutils/core.py", line 111, in setup
_setup_distribution = dist = klass(attrs)
File "build/bdist.linux-x86_64/egg/setuptools/dist.py", line 268, in
__init__
File "build/bdist.linux-x86_64/egg/setuptools/dist.py", line 313, in
fetch_build_eggs
File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 846, in resolve
File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 1091, in best_match
File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 1103, in obtain
File "build/bdist.linux-x86_64/egg/setuptools/dist.py", line 380, in fetch_build_egg
File "build/bdist.linux-x86_64/egg/setuptools/command/easy_install.py", line 633, in easy_install
distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('pytest-runner')
package/pkg-generic.mk:216: recipe for target '/home/nnnn/bldr_lab
/buildroot/output/build/python-chardet-3.0.3/.stamp_built' failed
make[1]: *** [/home/nnnn/bldr_lab/buildroot/output/build/python-chardet-
3.0.3/.stamp_built] Error 1
Makefile:79: recipe for target '_all' failed
make: *** [_all] Error 2
case 2 When I try to create the 'pytest-runner' with the scanpypi the following error message is shown:
nnnn#xxxx:~/bldr2/buildroot$ ./support/scripts/scanpypi pytest-runner -o package
buildroot package name for pytest-runner: python-pytest-runner
Package: python-pytest-runner
Fetching package pytest-runner
Downloading package pytest-runner from https://pypi.python.org/packages/9e/4d/08889e5e27a9f5d6096b9ad257f4dea1faabb03c5ded8f665ead448f5d8a/pytest-runner-2.11.1.tar.gz...
Error: Could not install package pytest-runner
When I download the 'pytest-runner-2.11.1.tar.gz' from pypi manually it looks as normal pypi tar file. Any idea what is root cause and how to solve the problem?
-timo-

Installing C SDK for couchbase, Mac OSX 10.6.8 -- How can I correct cmake errors?

I am trying to get couchbase up and running for python on Mac OSX 10.6.8. I'm following the instructions here:
http://docs.couchbase.com/couchbase-sdk-python-1.2/index.html#getting-started
But I'm stuck on step 2:
Download and install the C library.
According to the instructions for installing the C SDK here:
http://docs.couchbase.com/developer/c-2.4/download-install.html
I did this:
~$ brew update
....
....
~$ brew install libcouchbase
But I'm getting an error when homebrew tries to install the dependency cmake:
==> Installing libcouchbase dependency: cmake
==> Downloading http://www.cmake.org/files/v3.1/cmake-3.1.0.tar.gz
Already downloaded: /Library/Caches/Homebrew/cmake-3.1.0.tar.gz
==> Patching
==> Downloading https://pypi.python.org/packages/source/S/Sphinx/Sphinx-1.2.3.tar.gz
Already downloaded: /Library/Caches/Homebrew/cmake--sphinx-1.2.3.tar.gz
==> python -c import setuptools... install --prefix=/private/tmp/cmake-HcEaFf/cmake-3.1.0/sphinx --single-version-e
==> Downloading https://pypi.python.org/packages/source/M/MarkupSafe/MarkupSafe-0.23.tar.gz
Already downloaded: /Library/Caches/Homebrew/cmake--markupsafe-0.23.tar.gz
==> python -c import setuptools... install --prefix=/private/tmp/cmake-HcEaFf/cmake-3.1.0/sphinx --single-version-e
==> Downloading https://pypi.python.org/packages/source/d/docutils/docutils-0.12.tar.gz
Already downloaded: /Library/Caches/Homebrew/cmake--docutils-0.12.tar.gz
==> python -c import setuptools... install --prefix=/private/tmp/cmake-HcEaFf/cmake-3.1.0/sphinx --single-version-e
==> Downloading https://pypi.python.org/packages/source/P/Pygments/Pygments-2.0.1.tar.gz
Already downloaded: /Library/Caches/Homebrew/cmake--pygments-2.0.1.tar.gz
==> python -c import setuptools... install --prefix=/private/tmp/cmake-HcEaFf/cmake-3.1.0/sphinx --single-version-e
==> Downloading https://pypi.python.org/packages/source/J/Jinja2/Jinja2-2.7.3.tar.gz
Already downloaded: /Library/Caches/Homebrew/cmake--jinja2-2.7.3.tar.gz
==> python -c import setuptools... install --prefix=/private/tmp/cmake-HcEaFf/cmake-3.1.0/sphinx --single-version-e
==> ./bootstrap --prefix=/Users/7stud/.homebrew/Cellar/cmake/3.1.0 --system-libs --parallel=2 --no-system-libarchiv
==> make
[ 34%] Building C object Utilities/cmlibarchive/libarchive/CMakeFiles/cmlibarchive.dir/archive_write_set_options.c.o
[ 34%] Building C object Utilities/cmlibarchive/libarchive/CMakeFiles/cmlibarchive.dir/filter_fork_posix.c.o
Linking C static library libcmlibarchive.a
[ 34%] Built target cmlibarchive
make: *** [all] Error 2
READ THIS: http://git.io/brew-troubleshooting
These open issues may also help:
Fix LLVM CMake modules not being preprocessed (https://github.com/Homebrew/homebrew/pull/29976)
cmake builds fail on CLT-only with --env=std (https://github.com/Homebrew/homebrew/issues/29101)
More detail here:
~$ brew gist-logs --config --doctor cmake
https://gist.github.com/a37987f168d284128cfe
Anyone have any ideas on what I should do? Thanks.
Do you have the latest (available for 10.6.8) version of Xcode and its devtools? It appears to be an issue with GCC (I initially had issues with the LLVM gcc version Apple packages with Xcode).
Try brew install gcc (or brew reinstall gcc if you initially used brew to install gcc) and then run brew install make again.
I've got XCode version 3.2.6 installed, which I believe is the highest version compatible with OSX 10.6.8.
In the gist, whose link I posted, one of the errors is:
error: ncurses/ncurses.h: No such file or directory
I found ncurses.h on my system here:
/usr/include$ ls -al ncurses.h
lrwxr-xr-x 1 root wheel 8 Aug 11 2012 ncurses.h -> curses.h
...which if you note is not in a directory called ncurses(look at the prompt)--ncurses being the directory where the error message says ncurses.h should be. Also, note that ncurses.h is a link to another file: curses.h (see the arrow on the right?). So, I did this:
/usr/include$ sudo mkdir ncurses
Password:
/usr/include$ cd ncurses
/usr/include/ncurses$ sudo cp -av ../ncurses.h . (-a => copy link rather than the file it points to, -v => verbose, show what is being copied)
Password:
../ncurses.h -> ./ncurses.h
/usr/include/ncurses$ ls -al
total 8
drwxr-xr-x 3 root wheel 102 Dec 29 18:59 .
drwxr-xr-x 272 root wheel 9248 Dec 29 18:13 ..
lrwxr-xr-x 1 root wheel 8 Dec 29 18:59 ncurses.h -> curses.h
Then I tried installing libcouchbase again:
~$ brew install libcouchbase
==> Installing libcouchbase dependency: cmake
==> Downloading http://www.cmake.org/files/v3.1/cmake-3.1.0.tar.gz
Already downloaded: /Library/Caches/Homebrew/cmake-3.1.0.tar.gz
==> Patching
==> Downloading https://pypi.python.org/packages/source/J/Jinja2/Jinja2-2.7.3.tar.gz
Already downloaded: /Library/Caches/Homebrew/cmake--jinja2-2.7.3.tar.gz
==> python -c import setuptools... install --prefix=/private/tmp/cmake-FqXEf3/cmake-3.1
==> Downloading https://pypi.python.org/packages/source/M/MarkupSafe/MarkupSafe-0.23.ta
Already downloaded: /Library/Caches/Homebrew/cmake--markupsafe-0.23.tar.gz
==> python -c import setuptools... install --prefix=/private/tmp/cmake-FqXEf3/cmake-3.1
==> Downloading https://pypi.python.org/packages/source/d/docutils/docutils-0.12.tar.gz
Already downloaded: /Library/Caches/Homebrew/cmake--docutils-0.12.tar.gz
==> python -c import setuptools... install --prefix=/private/tmp/cmake-FqXEf3/cmake-3.1
==> Downloading https://pypi.python.org/packages/source/P/Pygments/Pygments-2.0.1.tar.g
Already downloaded: /Library/Caches/Homebrew/cmake--pygments-2.0.1.tar.gz
==> python -c import setuptools... install --prefix=/private/tmp/cmake-FqXEf3/cmake-3.1
==> Downloading https://pypi.python.org/packages/source/S/Sphinx/Sphinx-1.2.3.tar.gz
Already downloaded: /Library/Caches/Homebrew/cmake--sphinx-1.2.3.tar.gz
==> python -c import setuptools... install --prefix=/private/tmp/cmake-FqXEf3/cmake-3.1
==> ./bootstrap --prefix=/Users/7stud/.homebrew/Cellar/cmake/3.1.0 --system-libs --para
==> make
==> make install
/Users/7stud/.homebrew/Cellar/cmake/3.1.0: 1819 files, 33M, built in 18.5 minutes
==> Installing libcouchbase
==> Downloading http://packages.couchbase.com/clients/c/libcouchbase-2.4.5_1_gd7f6ecf.t
######################################################################## 100.0%
==> Patching
==> cmake .. -DCMAKE_INSTALL_PREFIX=/Users/7stud/.homebrew/Cellar/libcouchbase/2.4.5_1_
==> make install
/Users/7stud/.homebrew/Cellar/libcouchbase/2.4.5_1_gd7f6ecf: 53 files, 1.4M, built in 42 seconds
$
I didn't believe it, so I tried again:
~$ brew install libcouchbase
Warning: libcouchbase-2.4.5_1_gd7f6ecf already installed
~$ brew uninstall libcouchbase
Uninstalling /Users/7stud/.homebrew/Cellar/libcouchbase/2.4.5_1_gd7f6ecf...
~$ brew install libcouchbase
==> Downloading http://packages.couchbase.com/clients/c/libcouchbase-2.4.5_1_gd7f6ecf.t
Already downloaded: /Library/Caches/Homebrew/libcouchbase-2.4.5_1_gd7f6ecf.tar.gz
==> Patching
==> cmake .. -DCMAKE_INSTALL_PREFIX=/Users/7stud/.homebrew/Cellar/libcouchbase/2.4.5_1_
==> make install
/Users/7stud/.homebrew/Cellar/libcouchbase/2.4.5_1_gd7f6ecf: 53 files, 1.4M, built in 30 seconds
~$
Testing the install:
/usr/include/ncurses$ cbc version
cbc:
Runtime: Version=2.4.5_1_gd7f6ecf, Changeset=d7f6ecfa15e73c668a8f81947d9f85b654dcdbda
Headers: Version=2.4.5_1_gd7f6ecf, Changeset=d7f6ecfa15e73c668a8f81947d9f85b654dcdbda
IO: Default=libevent, Current=libevent
SSL: .. SUPPORTED
Python SDK
But then I was unable to install the Python SDK following the instructions here:
http://docs.couchbase.com/couchbase-sdk-python-1.2/
$ python -V
Python 2.7.9
I got to here:
5. Install the Python SDK. The easiest way to do this is via the pip tool:
shell> pip install couchbase --quiet
But this is what happened:
$ pip install couchbase --quiet
Command /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
-c "import setuptools;file='/private/var/folders/++/++iEr0qoGaimgUBsnNcijk+++TI/-Tmp-/pip_build_7stud/couchbase/setup.py';exec(compile(open(file).read().replace('\r\n',
'\n'), file, 'exec'))" install --record
/var/folders/++/++iEr0qoGaimgUBsnNcijk+++TI/-Tmp-/pip-eflT9C-record/install-record.txt --single-version-externally-managed failed with error code 1 in /private/var/folders/++/++iEr0qoGaimgUBsnNcijk+++TI/-Tmp-/pip_build_7stud/couchbase
Traceback (most recent call last): File
"/Library/Frameworks/Python.framework/Versions/2.7/bin/pip", line 9,
in
load_entry_point('pip==1.4.1', 'console_scripts', 'pip')() File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-1.4.1-py2.7.egg/pip/init.py",
line 148, in main
return command.main(args[1:], options) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-1.4.1-py2.7.egg/pip/basecommand.py",
line 169, in main
text = '\n'.join(complete_log) UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 63: ordinal not in range(128)
Same thing here:
$ LC_ALL=C pip install couchbase --quiet
Command /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
-c "import setuptools;file='/private/var/folders/++/++iEr0qoGaimgUBsnNcijk+++TI/-Tmp-/pip_build_7stud/couchbase/setup.py';exec(compile(open(file).read().replace('\r\n',
'\n'), file, 'exec'))" install --record
/var/folders/++/++iEr0qoGaimgUBsnNcijk+++TI/-Tmp-/pip-Oe6ydu-record/install-record.txt --single-version-externally-managed failed with error code 1 in /private/var/folders/++/++iEr0qoGaimgUBsnNcijk+++TI/-Tmp-/pip_build_7stud/couchbase
Storing complete log in /Users/7stud/.pip/pip.log
/usr/include/ncurses$ pip install couchbase --quiet Command
/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
-c "import setuptools;file='/private/var/folders/++/++iEr0qoGaimgUBsnNcijk+++TI/-Tmp-/pip_build_7stud/couchbase/setup.py';exec(compile(open(file).read().replace('\r\n',
'\n'), file, 'exec'))" install --record
/var/folders/++/++iEr0qoGaimgUBsnNcijk+++TI/-Tmp-/pip-GijsbQ-record/install-record.txt --single-version-externally-managed failed with error code 1 in /private/var/folders/++/++iEr0qoGaimgUBsnNcijk+++TI/-Tmp-/pip_build_7stud/couchbase
Traceback (most recent call last): File
"/Library/Frameworks/Python.framework/Versions/2.7/bin/pip", line 9,
in
load_entry_point('pip==1.4.1', 'console_scripts', 'pip')() File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-1.4.1-py2.7.egg/pip/init.py",
line 148, in main
return command.main(args[1:], options) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-1.4.1-py2.7.egg/pip/basecommand.py",
line 169, in main
text = '\n'.join(complete_log) UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 63: ordinal not in range(128)
I fixed the unicode error by patching the python source code:
#text = '\n'.join(complete_log)
#python 2.x patch found here: https://github.com/pypa/pip/issues/1137
text = '\n'.join(to_utf8(l) for l in complete_log)
But then I got this error:
$ pip install couchbase --quiet
Command /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
-c "import setuptools;file='/private/var/folders/++/++iEr0qoGaimgUBsnNcijk+++TI/-Tmp-/pip_build_7stud/couchbase/setup.py';exec(compile(open(file).read().replace('\r\n',
'\n'), file, 'exec'))" install --record
/var/folders/++/++iEr0qoGaimgUBsnNcijk+++TI/-Tmp-/pip-AQtdf2-record/install-record.txt --single-version-externally-managed failed with error code 1 in /private/var/folders/++/++iEr0qoGaimgUBsnNcijk+++TI/-Tmp-/pip_build_7stud/couchbase
Storing complete log in /Users/7stud/.pip/pip.log
$
(I just looked at the error log mentioned above: pip.log, and it says the error was a KeyboardInterrupt. Huh? So, I tried $ pip install couchbase --quiet again and it worked. Then, to test the install $ python -c 'import couchbase', and there were no errors! I don't know if the stuff I did below influenced anything.)
Next, I decided to try installing from source:
According to the README file:
~/Downloads/couchbase-1.2.4$ python setup.py build_ext --inplace
But that ended like this:
src/exceptions.c:136: error: too many arguments to function
‘pycbc_exc_map’ lipo: can't figure out the architecture type of:
/var/folders/++/++iEr0qoGaimgUBsnNcijk+++TI/-Tmp-//ccZekvJj.out error:
command 'gcc-4.2' failed with exit status 1
Next, I did this:
~/Downloads/couchbase-1.2.4$ python setup.py build_ext \
> --library-dir ~/.homebrew/Cellar/libcouchbase/2.4.5_1_gd7f6ecf/lib \
> --include-dir ~/.homebrew/Cellar/libcouchbase/2.4.5_1_gd7f6ecf/include
running build_ext building 'couchbase._libcouchbase' extension gcc-4.2
-fno-strict-aliasing -fno-common -dynamic -isysroot
...
...
intel-2.7/src/iops.o
build/temp.macosx-10.6-intel-2.7/src/connevents.o
build/temp.macosx-10.6-intel-2.7/src/pipeline.o
build/temp.macosx-10.6-intel-2.7/src/viewrow/viewrow.o
build/temp.macosx-10.6-intel-2.7/src/contrib/jsonsl/jsonsl.o
-L/Users/7stud/.homebrew/Cellar/libcouchbase/2.4.5_1_gd7f6ecf/lib -lcouchbase -o build/lib.macosx-10.6-intel-2.7/couchbase/_libcouchbase.so
...which ended without error. But testing the install failed:
~/Downloads/couchbase-1.2.4$ python -c 'import couchbase'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "couchbase/__init__.py", line 18, in <module>
from couchbase.connection import Connection
File "couchbase/connection.py", line 22, in <module>
import couchbase._bootstrap
File "couchbase/_bootstrap.py", line 34, in <module>
import couchbase.exceptions as E
File "couchbase/exceptions.py", line 18, in <module>
import couchbase._libcouchbase as C
ImportError: No module named _libcouchbase
So, I thought what the heck, I'll go ahead and try this:
~/Downloads/couchbase-1.2.4$ python setup.py install
...
...
Installed /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/couchbase-1.2.4-py2.7-macosx-10.6-intel.egg
Processing dependencies for couchbase==1.2.4
Finished processing dependencies for couchbase==1.2.4
But, I got the same import error when testing the install, so I gave up.
After reading the answer to my question, I did:
$ brew install gcc
but I didn't try to fix couchbase until now. I don't think installing gcc with homebrew did anything because I still get:
~$ gcc --version
i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc.
build 5666) (dot 3) Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There
is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
/usr/bin$ which gcc
/usr/bin/gcc
/usr/bin$ ls -al /usr/bin/gcc
lrwxr-xr-x 1 root wheel 7 Aug 11 2012 /usr/bin/gcc -> gcc-4.2
...which is the Apple version of gcc. But, when I installed gcc with homebrew I got the output:
/Users/7stud/.homebrew/Cellar/gcc/4.9.2_1: 1155 files, 200M, built in
106.8 minutes
...which is gcc version 4.9.