I installed pcketsphinx on Anaconda using conda-forge in this way.
conda install -c conda-forge pocketsphinx
And then I got the following message
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
PackagesNotFoundError: The following packages are not available from current channels:
- pocketsphinx
Current channels:
- https://conda.anaconda.org/conda-forge/win-64
- https://conda.anaconda.org/conda-forge/noarch
- https://repo.anaconda.com/pkgs/main/win-64
- https://repo.anaconda.com/pkgs/main/noarch
- https://repo.anaconda.com/pkgs/r/win-64
- https://repo.anaconda.com/pkgs/r/noarch
- https://repo.anaconda.com/pkgs/msys2/win-64
- https://repo.anaconda.com/pkgs/msys2/noarch
To search for alternate channels that may provide the conda package you're
looking for, navigate to
https://anaconda.org
and use the search bar at the top of the page.
Why does it say "The following packages are not available from current channels:"?
How do I make pocketsphinx available to me?
I also tried pip install, but got an error.
pip install pocketsphinx
ERROR: Command errored out with exit status 1:
command: 'C:\Users\taichi\Anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\taichi\\AppData\\Local\\Temp\\pip-install-ha8v9dja\\pocketsphinx\\setup.py'"'"'; __file__='"'"'C:\\Users\\taichi\\AppData\\Local\\Temp\\pip-install-ha8v9dja\\pocketsphinx\\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:\Users\taichi\AppData\Local\Temp\pip-wheel-2isplwue' --python-tag cp37
cwd: C:\Users\taichi\AppData\Local\Temp\pip-install-ha8v9dja\pocketsphinx\
Complete output (6 lines):
running bdist_wheel
running build_ext
building 'sphinxbase._sphinxbase' extension
swigging deps/sphinxbase/swig/sphinxbase.i to deps/sphinxbase/swig/sphinxbase_wrap.c
swig.exe -python -modern -threads -Ideps/sphinxbase/include -Ideps/sphinxbase/include/sphinxbase -Ideps/sphinxbase/include/win32 -Ideps/sphinxbase/swig -outdir sphinxbase -o deps/sphinxbase/swig/sphinxbase_wrap.c deps/sphinxbase/swig/sphinxbase.i
error: command 'swig.exe' failed: No such file or directory
----------------------------------------
ERROR: Failed building wheel for pocketsphinx
Running setup.py clean for pocketsphinx
Failed to build pocketsphinx
Installing collected packages: pocketsphinx
Running setup.py install for pocketsphinx ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\taichi\Anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\taichi\\AppData\\Local\\Temp\\pip-install-ha8v9dja\\pocketsphinx\\setup.py'"'"'; __file__='"'"'C:\\Users\\taichi\\AppData\\Local\\Temp\\pip-install-ha8v9dja\\pocketsphinx\\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:\Users\taichi\AppData\Local\Temp\pip-record-8osso05j\install-record.txt' --single-version-externally-managed --compile
cwd: C:\Users\taichi\AppData\Local\Temp\pip-install-ha8v9dja\pocketsphinx\
Complete output (6 lines):
running install
running build_ext
building 'sphinxbase._sphinxbase' extension
swigging deps/sphinxbase/swig/sphinxbase.i to deps/sphinxbase/swig/sphinxbase_wrap.c
swig.exe -python -modern -threads -Ideps/sphinxbase/include -Ideps/sphinxbase/include/sphinxbase -Ideps/sphinxbase/include/win32 -Ideps/sphinxbase/swig -outdir sphinxbase -o deps/sphinxbase/swig/sphinxbase_wrap.c deps/sphinxbase/swig/sphinxbase.i
error: command 'swig.exe' failed: No such file or directory
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\taichi\Anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\taichi\\AppData\\Local\\Temp\\pip-install-ha8v9dja\\pocketsphinx\\setup.py'"'"'; __file__='"'"'C:\\Users\\taichi\\AppData\\Local\\Temp\\pip-install-ha8v9dja\\pocketsphinx\\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:\Users\taichi\AppData\Local\Temp\pip-record-8osso05j\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.
I'm using Anaconda3 and Python 3.7.4 and Windows 10 64bit.
I came across what looks like the same problem and was able to solve it with the following steps. Hopefully this will help you and others, at least to get started. Consider the following general points:
Anaconda/Miniconda had a version of gcc that was picked up as the default compiler and, it seems, was interfering. Make sure gcc is picking up the desired compiler. To see what compilers you have, start up a terminal window, type gcc+TAB (gcc followed by a tab). This should show all the versions you have on your system. Type gcc --version to see which version is the default. And which gcc to find out where it is located, e.g. /Users/PatrickT/miniconda/bin/gcc
You want to ensure that your system's PATH can find your compiler. This may be done by adding an export command to your bash profile. On Catalina, apparently, the bash profile information would be placed in .zshrc. To find this file, type COMMAND+SHIFT+E to make invisible files visible and look in your home directory (/Users/PatrickT in my case). For instance, add a line like export PATH="/usr/local/gcc-10/bin:$PATH". The path is of course dependent on your system.
To make sure miniconda was not interfering, I took it off the PATH altogether. I also installed the latest version of xcode from the apple binaries. Once I had an updated version of the gcc compiler found by my system, I was able to install pocketsphinx as well as other programs that I was having problems with, like kaldi or zlib.
Getting miniconda to work again without interfering with gcc is a problem I haven't solved. As soon as I put miniconda back on the PATH, the default gcc reverted to the miniconda version. To be continued...
You can:
pip install pipwin
and
pipwin install pocketsphinx
I was having the same issue and got into this site:
https://cppsecrets.com/users/11429798104105115104101107117115104119971049754494864103109971051084699111109/python-pocketsphinx-installation-on-windows.php
Related
I'm using pip 20.2.3 on Linux to install additional packages (extras_require['test']) into a project that was first built using python setup.py build -b _build. In the project's directory, there's also a custom script called build (whose name I shouldn't change). When I run pip install .[test] it complains that build already exists and fails:
$ echo $TMPDIR
/.local/work/.ab/
$ pip install .[test]
[...]
ERROR: Command errored out with exit status 1:
command: /[...]/venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/.local/work/.ab/pip-req-build-qxn943bk/setup.py'"'"'; __file__='"'"'/.local/work/.ab/pip-req-build-qxn943bk/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 /.local/work/.dv/pip-wheel-yhzxeqaj
cwd: /.local/work/.ab/pip-req-build-qxn943bk/
Complete output (5 lines):
running bdist_wheel
running build
running build_py
creating build
error: could not create 'build': File exists
----------------------------------------
ERROR: Failed building wheel for xxx
I've tried passing --build to pip but the option is marked as deprecated in man page and is obviously ignored.
Is there any other way I can make pip use another name for its build directory (e.g. _build), or is there a way to use python setup.py build -b _build to install only the extras_require['test'] packages?
I would like to use python-saml for sso integration with flask web app. while I am trying to install python-saml package using pip install python-saml, I am getting the below error message.
(myvenv) C:\Users\sekar>pip install python3-saml==1.9.0
Collecting python3-saml==1.9.0
Using cached python3_saml-1.9.0-py3-none-any.whl (72 kB)
Collecting xmlsec>=0.6.0
Using cached xmlsec-1.3.3.tar.gz (29 kB)
Building wheels for collected packages: xmlsec
Building wheel for xmlsec (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\sekar\AppData\Local\conda\conda\envs\myvenv\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\sekar\\AppData\\Local\\Temp\\16\\pip-install-9x0le85b\\xmlsec\\setup.py'"'"'; __file__='"'"'C:\\Users\\sekar\\AppData\\Local\\Temp\\16\\pip-install-9x0le85b\\xmlsec\\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:\Users\sekar\AppData\Local\Temp\16\pip-wheel-39e4ydgb'
cwd: C:\Users\sekar\AppData\Local\Temp\16\pip-install-9x0le85b\xmlsec\
Complete output (5 lines):
running bdist_wheel
running build
running build_ext
error: HTTP Error 404: The specified blob does not exist.
Retrieving "https://ci.appveyor.com/api/buildjobs/hij3a6776pdv2007/artifacts/libxml2-2.9.4.win64.zip" to "build/extra\libxml2-2.9.4.win64.zip"
----------------------------------------
ERROR: Failed building wheel for xmlsec
Running setup.py clean for xmlsec
Failed to build xmlsec
Installing collected packages: xmlsec, python3-saml
Running setup.py install for xmlsec ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\sekar\AppData\Local\conda\conda\envs\myvenv\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\sekar\\AppData\\Local\\Temp\\16\\pip-install-9x0le85b\\xmlsec\\setup.py'"'"'; __file__='"'"'C:\\Users\\sekar\\AppData\\Local\\Temp\\16\\pip-install-9x0le85b\\xmlsec\\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:\Users\sekar\AppData\Local\Temp\16\pip-record-l_q25m6k\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\sekar\AppData\Local\conda\conda\envs\myvenv\Include\xmlsec'
cwd: C:\Users\sekar\AppData\Local\Temp\16\pip-install-9x0le85b\xmlsec\
Complete output (5 lines):
running install
running build
running build_ext
error: HTTP Error 404: The specified blob does not exist.
Retrieving "https://ci.appveyor.com/api/buildjobs/hij3a6776pdv2007/artifacts/libxml2-2.9.4.win64.zip" to "build/extra\libxml2-2.9.4.win64.zip"
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\sekar\AppData\Local\conda\conda\envs\myvenv\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\sekar\\AppData\\Local\\Temp\\16\\pip-install-9x0le85b\\xmlsec\\setup.py'"'"'; __file__='"'"'C:\\Users\\sekar\\AppData\\Local\\Temp\\16\\pip-install-9x0le85b\\xmlsec\\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:\Users\sekar\AppData\Local\Temp\16\pip-record-l_q25m6k\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\sekar\AppData\Local\conda\conda\envs\myvenv\Include\xmlsec' Check the logs for full command output.
I tried with conda install python-saml, same error also they stopped this package 2 years before. even I tried python3-saml
the core issue is in xmlsec package..
is there any conda channels or PYPI provide this package?
Update
Since version 1.3.7, prebuilt wheels of xmlsec for Windows are published on PyPI, so you shouldn't experience this issue anymore.
Original answer
I have rebuilt xmlsec windows wheels and uploaded them to the releases page of my fork. To install, first install xmlsec passing the additional PyPI index:
$ pip install xmlsec --extra-index-url=https://hoefling.io/pypi
The added index just proxies install request to Github releases.
Now install python3-saml:
$ pip install python3-saml
(Alternative) Selecting the dist manually
You can manually find the wheel matching your Python installation from the releases page and install it using a direct link, e.g.
$ python -c "from pip._internal.pep425tags import get_supported; print(*get_supported()[0], sep='-')"
cp37-cp37m-win_amd64
# the matching wheel is thus xmlsec-1.3.6.post1-cp37-cp37m-win_amd64.whl
$ pip install https://github.com/hoefling/xmlsec/releases/download/1.3.6.post1/xmlsec-1.3.6.post1-cp37-cp37m-win_amd64.whl
(Optional) Verify xmlsec works by invoking the tests
I have executed tests against all built wheels (check out this job log on Appveyor), but you can also run the tests locally to verify xmlsec installation is working:
$ git clone https://github.com/mehcode/python-xmlsec.git && cd python-xmlsec
$ pip install pytest
$ pytest tests/
Never used python-saml here... However, while searching this error, I found these GitHub issues: Issue 1 and Issue 2
Both of them talk about a problem with dm.xmlsec.binding.
Best,
Felipe
I'm trying to do the follow code with OpenAI:
import gym
env = gym.make('CarRacing-v0')
env.reset()
for _ in range(1000):
env.render()
env.step(env.action_space.sample())
but it throws the error:
fn = getattr(mod, attr_name)
AttributeError: module 'gym.envs.box2d' has no attribute 'CarRacing'
And then I try to install box2d by pip install box2d-py throwing this error:
ERROR: Command errored out with exit status 1:
command: 'C:\Users\Junior\Anaconda\envs\gym\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Junior\\AppData\\Local\\Temp\\pip-install-w8awn22p\\box2d-py\\setup.py'"'"'; __file__='"'"'C:\\Users\\Junior\\AppData\\Local\\Temp\\pip-install-w8awn22p\\box2d-py\\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:\Users\Junior\AppData\Local\Temp\pip-record-netg1nlq\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\Junior\Anaconda\envs\gym\Include\box2d-py'
cwd: C:\Users\Junior\AppData\Local\Temp\pip-install-w8awn22p\box2d-py\
Complete output (16 lines):
Using setuptools (version 45.2.0.post20200210).
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
creating build\lib.win-amd64-3.7\Box2D
copying library\Box2D\Box2D.py -> build\lib.win-amd64-3.7\Box2D
copying library\Box2D\__init__.py -> build\lib.win-amd64-3.7\Box2D
creating build\lib.win-amd64-3.7\Box2D\b2
copying library\Box2D\b2\__init__.py -> build\lib.win-amd64-3.7\Box2D\b2
running build_ext
building 'Box2D._Box2D' extension
swigging Box2D\Box2D.i to Box2D\Box2D_wrap.cpp
swig.exe -python -c++ -IBox2D -small -O -includeall -ignoremissing -w201 -globals b2Globals -outdir library\Box2D -keyword -w511 -D_SWIG_KWARGS -o Box2D\Box2D_wrap.cpp Box2D\Box2D.i
error: command 'swig.exe' failed: No such file or directory
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\Junior\Anaconda\envs\gym\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Junior\\AppData\\Local\\Temp\\pip-install-w8awn22p\\box2d-py\\setup.py'"'"'; __file__='"'"'C:\\Users\\Junior\\AppData\\Local\\Temp\\pip-install-w8awn22p\\box2d-py\\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:\Users\Junior\AppData\Local\Temp\pip-record-netg1nlq\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\Junior\Anaconda\envs\gym\Include\box2d-py' Check the logs for full command output.
what I have to do to install it successfully?
Windows support is at present moment experimental (source). That being said, on most of the occasions you will get it to work, but some of the functionality could be broken. Proceed with caution.
Here's what could work:
Install Anaconda.
Start Anaconda command line (it adds conda to the PATH).
conda create -c conda-forge -n gymenv swig pip - create base environment.
conda activate gymenv - activate it.
pip install Box2D gym - install base gym with Box2D.
(Optional) pip install gym[all] - install all components of Gym. You might run into errors.
If you get build errors on missing compilers, install Visual Studio Built Tools.
Depending on the component you're using, you might need e.g. pystan. Activate then the conda environment and install it, i.e. conda install pystan.
An alternative could be to try to install Gym directly through conda:
conda create -c conda-forge -c powerai -n gymenv gym swig pip pystan
This will install gym from powerai channel. Might work, but mind that it's not the latest nor seems to be supported by devs.
I got it sorted with just installing swig before gym[box2d] no anaconda needed
pip3 install swig
In my case, I used the conda to install Gym's Box2D:
conda install swig
conda install -c conda-forge gym-box2d
and got rid of this error.
(As a windows user) For me, the solution was to download and install the latest stable version of Build Tools pour Visual Studio (2022 currently). Then the pip install gym[box2d] worked.
I tried to install jnius, I installed Visual Studio Build Tools, but when I enter pip install jnius, I get error:
ERROR: Command errored out with exit status 1:
'c:\users\вввв\appdata\local\programs\python\python37-32\python.exe' -u -c 'import sys, setuptools,
tokenize; sys.argv[0] = '"'"'C:\\Users\\1D87~1\\AppData\\Local\\Temp\\pip-install-
9ggkbbff\\jnius\\setup.py'"'"'; __file__='"'"'C:\\Users\\1D87~1\\AppData\\Local\\Temp\\pip-install-
9ggkbbff\\jnius\\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:\Users\1D87~1\AppData\Local\Temp\pip-record-
hczhl1cy\install-record.txt' --single-version-externally-managed --compile Check the logs for full
command output.
ERROR: Failed building wheel for jnius
How can I fix it?
I hope you help me
jnius, which is this pypi project does not support python 3.7 officially.
A quick google search however yields that the module is now called pyjnius, see this GitHub page:
Warning: the pypi name is now pyjnius instead of jnius.
So use the correct version and do:
pip install pyjnius
There are whl files for windows and python 3.7, so the installation should go smoothly. If not, you can check the installation instructions in the docs
EDIT: Looks like I have to install Visual Studio 2015...Can I install dlib without VS 2015? I already have older versions pre-installed with Windows.
I am using Python 3.5, trying to install dlib on PyCharm in the terminal and this is what I am getting, and every search on these errors I do... I find stuff on Visual Studio which I don't have the GUI + I don't have vcvarsall.bat in the VC folder of any of the Visual Studio versions (8, 11, 12, 14). I have searched a good amount before posting this question on the Web.
Do I need to download Visual Studio latest version to get vcvarsall.bat ?
This is CMakeLists.txt:
cmake_minimum_required(VERSION ${CMAKE_VERSION})
project(IntelFortranImplicit Fortran)
add_custom_command(
OUTPUT output.cmake
COMMAND ${CMAKE_COMMAND} -P ${IntelFortranImplicit_SOURCE_DIR}/detect.cmake
)
add_library(FortranLib hello.f output.cmake)
This is the error when I do: pip install dlib
Collecting dlib
Using cached dlib-19.6.1.tar.gz
Building wheels for collected packages: dlib
Running setup.py bdist_wheel for dlib ... error
Complete output from command C:\Users\tiger\Anaconda3\envs\TensorFlowExample\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\tiger\\AppDat
a\\Local\\Temp\\pip-build-gjtgkl6a\\dlib\\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:\Users\tiger\AppData\Local\Temp\tmprc21rnv_pip-wheel- --python-tag cp35:
running bdist_wheel
running build
error: Cannot find cmake, ensure it is installed and in the path.
You can install cmake using the instructions at https://cmake.org/install/
You can also specify its path with --cmake parameter.
----------------------------------------
Failed building wheel for dlib
Running setup.py clean for dlib
Failed to build dlib
Installing collected packages: dlib
Running setup.py install for dlib ... error
Complete output from command C:\Users\tiger\Anaconda3\envs\TensorFlowExample\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\tiger\\AppD
ata\\Local\\Temp\\pip-build-gjtgkl6a\\dlib\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(co
de, __file__, 'exec'))" install --record C:\Users\tiger\AppData\Local\Temp\pip-dk1naa28-record\install-record.txt --single-version-externally-managed --compile
:
running install
running build
error: Cannot find cmake, ensure it is installed and in the path.
You can install cmake using the instructions at https://cmake.org/install/
You can also specify its path with --cmake parameter.
----------------------------------------
Command "C:\Users\tiger\Anaconda3\envs\TensorFlowExample\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\tiger\\AppData\\Local\\Temp\\pip-bu
ild-gjtgkl6a\\dlib\\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:\Users\tiger\AppData\Local\Temp\pip-dk1naa28-record\install-record.txt --single-version-externally-managed --compile" failed with error code
1 in C:\Users\tiger\AppData\Local\Temp\pip-build-gjtgkl6a\dlib\
Solution found here: Using Anaconda installing manager..!
Running the following in PyCharm Terminal: conda install -c conda-forge dlib=19.4
I was able to use dlib! :)
Huge thanks to birryree in the comments for letting me know!
Open Anaconda Prompt in Administrative mode.
conda update conda 3. conda update anaconda
conda create -n dlib_env python=3.7
conda activate dlib_env
conda install -c conda-forge dlib
python
7.1 >>> import dlib 7.2 >>> dlib.version
Source