Error command swig exe failed none

I'm getting something like this. Can anyone please tell me how to fix this. C:UserskrushDocumentsML using Python>pip install pocketsphinx Collecting pocketsphinx Using cached pocketsphinx...

I’m getting something like this. Can anyone please tell me how to fix this.

C:UserskrushDocumentsML using Python>pip install pocketsphinx
Collecting pocketsphinx
  Using cached pocketsphinx-0.1.3.zip
Building wheels for collected packages: pocketsphinx
  Running setup.py bdist_wheel for pocketsphinx: started
  Running setup.py bdist_wheel for pocketsphinx: finished with status 'error'
  Complete output from command C:UserskrushAnaconda3python.exe -u -c "import setuptools, tokenize;__file__='C:\Users\krush\AppData\Local\Temp\pip-build-cns2i_wb\pocketsphinx\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d C:UserskrushAppDataLocalTemptmp3tyvnl9wpip-wheel- --python-tag cp36:
  running bdist_wheel
  running build_ext
  building 'sphinxbase._ad' extension
  swigging swig/sphinxbase/ad.i to swig/sphinxbase/ad_wrap.c
  swig.exe -python -modern -Ideps/sphinxbase/include -Ideps/sphinxbase/include/sphinxbase -Ideps/sphinxbase/include/win32 -Ideps/sphinxbase/swig -outdir sphinxbase -o swig/sphinxbase/ad_wrap.c swig/sphinxbase/ad.i
  error: command 'swig.exe' failed: No such file or directory

  ----------------------------------------
  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: started
    Running setup.py install for pocketsphinx: finished with status 'error'
    Complete output from command C:UserskrushAnaconda3python.exe -u -c "import setuptools, tokenize;__file__='C:\Users\krush\AppData\Local\Temp\pip-build-cns2i_wb\pocketsphinx\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:UserskrushAppDataLocalTemppip-x5mxeczy-recordinstall-record.txt --single-version-externally-managed --compile:
    running install
    running build_ext
    building 'sphinxbase._ad' extension
    swigging swig/sphinxbase/ad.i to swig/sphinxbase/ad_wrap.c
    swig.exe -python -modern -Ideps/sphinxbase/include -Ideps/sphinxbase/include/sphinxbase -Ideps/sphinxbase/include/win32 -Ideps/sphinxbase/swig -outdir sphinxbase -o swig/sphinxbase/ad_wrap.c swig/sphinxbase/ad.i
    error: command 'swig.exe' failed: No such file or directory

    ----------------------------------------
Command "C:UserskrushAnaconda3python.exe -u -c "import setuptools, tokenize;__file__='C:\Users\krush\AppData\Local\Temp\pip-build-cns2i_wb\pocketsphinx\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:UserskrushAppDataLocalTemppip-x5mxeczy-recordinstall-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:UserskrushAppDataLocalTemppip-build-cns2i_wbpocketsphinx

Nikolay Shmyrev's user avatar

asked Jun 12, 2017 at 16:59

Krushi Raj's user avatar

2

To fix the problem, I downloaded swig for windows at the time of writing this answer it was 3.0.12

For the latest swig windows version follow this link

  1. Copy swig.exe to the python installation folder (for ex C:/python27)

  2. Open the swigwin-3.0.12/Lib folder and copy all *.swg files to the C:/python27/Lib or equivalent python path

  3. Open swigwin-3.0.12/Lib/python and copy all the files to C:/python27/Lib

  4. Open the swigwin-3.0.12/Lib folder and copy over the typemaps folder to C:/python27/Lib

(Also make sure you have Microsoft Visual C++ Compiler for Python installed)

These steps worked for me.

answered May 1, 2018 at 14:09

Jay Shenawy's user avatar

Jay ShenawyJay Shenawy

9031 gold badge11 silver badges22 bronze badges

6

conda install swig
pip install pocketsphinx

I didn’t want to do all that setup other people are suggesting so I tried this and it worked.
This probably only works if you are using Anaconada though.

answered Sep 28, 2019 at 8:16

Jaideep Heer's user avatar

3

Instead of copying Swig files to the Python folder, you can simply add Swig`s location to the environment variables:

  1. Press Ctrl+S
  2. Type env and press Enter
  3. Double click on Path
  4. Add the path-to-Swig to the last blank line
  5. Click OK and restart your PC

answered Sep 14, 2018 at 9:54

W Barreto's user avatar

W BarretoW Barreto

4384 silver badges11 bronze badges

4

You try to install pocketsphinx with pip, that will download and compile this module. It requires some compiling tool like swig.

Another solution is to install a binary version of pocketsphinx. You can download a binary version here. You have to select the correct version with respect to your installation.

To determine which one you have to download, you can run the following commands, that will tell you which version you require and whether you run a 32 or 64 bit python interpreter.

"C:UserskrushAnaconda3python.exe" --version
"C:UserskrushAnaconda3python.exe" -c "import struct;print(struct.calcsize('P') * 8)"

Below are some commands that you may enter once you have downloaded the correct version

"C:UserskrushAnaconda3python.exe" -m pip install pocketsphinx‑0.1.3‑cp35‑cp35m‑win32.whl
"C:UserskrushAnaconda3python.exe" -m pip install pocketsphinx‑0.1.3‑cp36‑cp36m‑win_amd64.whl

answered Jun 12, 2017 at 19:23

Guillaume Jacquenot's user avatar

3

I was also getting same error, while installing in ubuntu 16.04, I executed following commands:

sudo apt-get install -y python python-dev python-pip build-essential swig git libpulse-dev

sudo pip install pocketsphinx

source: pocketsphinx-python

answered Sep 12, 2018 at 11:33

Ramesh Kumar's user avatar

Ramesh KumarRamesh Kumar

1,43814 silver badges16 bronze badges

In case you are working on anaconda navigator.
Just go to environment.
Search swig, your package will be displayed. Select the package and click on apply button.
It will also give a prompt list of other dependencies, which need to be installed with swig.
So just select all and click on apply button.
All the dependencies will be installed in your root directory of anaconda.

This worked for me, hope it helps.

answered Aug 6, 2019 at 13:51

ambar mishra's user avatar

There are few set of commands to resolve this. Just execute them:

sudo apt-get install -y python3 python3-dev python3-pip build-essential swig git libpulse-dev

sudo apt-get install libasound2-dev

sudo pip install pocketsphinx

answered Apr 29, 2019 at 7:19

Nitish nagar's user avatar

what works for me is installing swing from conda and

conda install swig

if installed search where it is installed

where swig

enter image description here

then add that path to your environment variable

torayeff's user avatar

torayeff

8,98618 gold badges67 silver badges102 bronze badges

answered Sep 29, 2020 at 17:30

Mostafa Farrag's user avatar

For mac users getting similar issues, there seems to be a problem with the current pip install framework. I followed this thread and used the solution linked. It doesn’t seem like there will be a pip fix anytime soon.

Note you’ll have to brew install swig before running the above steps — homebrew install link.

Dharman's user avatar

Dharman

29.3k21 gold badges80 silver badges131 bronze badges

answered Mar 31, 2021 at 14:49

Michael Berk's user avatar

pip install pipwin
python -m pipwin install pocketsphinx

You can also use pipwin to install pocketsphinx.

answered Jan 20, 2022 at 1:41

brandav's user avatar

brandavbrandav

5733 silver badges9 bronze badges

For a purely pip-based fix (may or not work depending on your exact issue/system):

pip install swig
pip install pocketsphinx
pip freeze > requirements.txt

Fixed the issue simply for me. With pip freeze, you’re likely to not have the issue again if cloning the project in another system (since swig will be installed just with pip install -r requirements.txt)

This is the kind of things for which it becomes REALLY worthwhile to look into using virtualenv or similar, instead of polluting (and endlessly re-configuring) your system.

answered Jul 19, 2022 at 19:54

logicOnAbstractions's user avatar

I know I am late, but what worked for me was to download the pre-built wheel file and install it manually (tested on Windows. I am pretty sure it will only work on Windows).

https://www.lfd.uci.edu/~gohlke/pythonlibs/#pocketsphinx

Just grab the right one (cp39 = python 3.9). When it finishes downloading, navigate to your downloads folder in cmd, and issue the following command:

pip install pocketsphinx-0.1.15-cp39-cp39-win_amd64.whl

NOTE: Change pocketsphinx-0.1.15-cp39-cp39-win_amd64.whl to the name of the whl file you downloaded. I grabbed this one because I use Python 3.9 64bit version.

answered Jul 24, 2022 at 15:37

CPSuperstore's user avatar

Hi again, I tried both of the solutions and they didn’t work, here are the error messages:

1. solution
pip uninstall gym
pip install gym[box2d]

Collecting gym[box2d]
Using cached gym-0.23.1-py3-none-any.whl
Requirement already satisfied: numpy>=1.18.0 in c:usersfehimpycharmprojectscyberneticsvenvlibsite-packages (from gym[box2d]) (1.22.2)
Requirement already satisfied: cloudpickle>=1.2.0 in c:usersfehimpycharmprojectscyberneticsvenvlibsite-packages (from gym[box2d]) (2.0.0)
Requirement already satisfied: importlib-metadata>=4.10.0 in c:usersfehimpycharmprojectscyberneticsvenvlibsite-packages (from gym[box2d]) (4.11.3)
Requirement already satisfied: gym-notices>=0.0.4 in c:usersfehimpycharmprojectscyberneticsvenvlibsite-packages (from gym[box2d]) (0.0.6)
Collecting box2d-py==2.3.5
Using cached box2d-py-2.3.5.tar.gz (374 kB)
Preparing metadata (setup.py) … done
Collecting pygame==2.1.0
Using cached pygame-2.1.0-cp39-cp39-win_amd64.whl (4.8 MB)
Requirement already satisfied: zipp>=0.5 in c:usersfehimpycharmprojectscyberneticsvenvlibsite-packages (from importlib-metadata>=4.10.0->gym[box2d]) (3.8.0)
Building wheels for collected packages: box2d-py
Building wheel for box2d-py (setup.py) … error
error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [16 lines of output]
Using setuptools (version 57.0.0).
running bdist_wheel
running build
running build_py
creating build
creating buildlib.win-amd64-3.9
creating buildlib.win-amd64-3.9Box2D
copying libraryBox2DBox2D.py -> buildlib.win-amd64-3.9Box2D
copying libraryBox2D_init_.py -> buildlib.win-amd64-3.9Box2D
creating buildlib.win-amd64-3.9Box2Db2
copying libraryBox2Db2_init_.py -> buildlib.win-amd64-3.9Box2Db2
running build_ext
building ‘Box2D._Box2D’ extension
swigging Box2DBox2D.i to Box2DBox2D_wrap.cpp
swig.exe -python -c++ -IBox2D -small -O -includeall -ignoremissing -w201 -globals b2Globals -outdir libraryBox2D -keyword -w511 -D_SWIG_KWARGS -o Box2DBox2D_wrap.cpp Box2DBox2D.i
error: command ‘swig.exe’ failed: None
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for box2d-py
Running setup.py clean for box2d-py
Failed to build box2d-py
Installing collected packages: box2d-py, pygame, gym
Running setup.py install for box2d-py … error
error: subprocess-exited-with-error

× Running setup.py install for box2d-py did not run successfully.
│ exit code: 1
╰─> [16 lines of output]
Using setuptools (version 57.0.0).
running install
running build
running build_py
creating build
creating buildlib.win-amd64-3.9
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> box2d-py

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

2. solution
pip install gym[box2d] pygame

Collecting box2d
Using cached Box2D-2.3.2.tar.gz (427 kB)
Preparing metadata (setup.py) … done
Requirement already satisfied: pygame in c:usersfehimpycharmprojectscyberneticsvenvlibsite-packages (2.1.2)
Building wheels for collected packages: box2d
Building wheel for box2d (setup.py) … error
error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [16 lines of output]
Using setuptools (version 57.0.0).
running bdist_wheel
running build
running build_py
creating build
creating buildlib.win-amd64-3.9
creating buildlib.win-amd64-3.9Box2D
copying libraryBox2DBox2D.py -> buildlib.win-amd64-3.9Box2D
copying libraryBox2D_init_.py -> buildlib.win-amd64-3.9Box2D
creating buildlib.win-amd64-3.9Box2Db2
copying libraryBox2Db2_init_.py -> buildlib.win-amd64-3.9Box2Db2
running build_ext
building ‘Box2D._Box2D’ extension
swigging Box2DBox2D.i to Box2DBox2D_wrap.cpp
swig.exe -python -c++ -IBox2D -small -O -includeall -ignoremissing -w201 -globals b2Globals -outdir libraryBox2D -keyword -w511 -D_SWIG_KWARGS -o Box2DBox2D_wrap.cpp Box2DBox2D.i
error: command ‘swig.exe’ failed: None
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for box2d
Running setup.py clean for box2d
Failed to build box2d
Installing collected packages: box2d
Running setup.py install for box2d … error
error: subprocess-exited-with-error

× Running setup.py install for box2d did not run successfully.
│ exit code: 1
╰─> [16 lines of output]
Using setuptools (version 57.0.0).
running install
running build
running build_py
creating build
creating buildlib.win-amd64-3.9
creating buildlib.win-amd64-3.9Box2D
copying libraryBox2DBox2D.py -> buildlib.win-amd64-3.9Box2D
copying libraryBox2D_init_.py -> buildlib.win-amd64-3.9Box2D
creating buildlib.win-amd64-3.9Box2Db2
copying libraryBox2Db2_init_.py -> buildlib.win-amd64-3.9Box2Db2
running build_ext
building ‘Box2D._Box2D’ extension
swigging Box2DBox2D.i to Box2DBox2D_wrap.cpp
swig.exe -python -c++ -IBox2D -small -O -includeall -ignoremissing -w201 -globals b2Globals -outdir libraryBox2D -keyword -w511 -D_SWIG_KWARGS -o Box2DBox2D_wrap.cpp Box2DBox2D.i
error: command ‘swig.exe’ failed: None
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> box2d

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

Sorry for the late reply

Содержание

  1. pyscard installation via pip fails on win7 x64 (missing dependencys?) #55
  2. Comments
  3. pyWinhook fails to build when installing PsychoPy 3.0.2 #2222
  4. Comments
  5. Установка python-модуля pocketsphinx: команда ‘swig.exe’ завершилась неудачно
  6. 5 ответов
  7. Failed building wheel for pocketsphinx #209
  8. Comments
  9. Установка модуля python для pocketsphinx: команда ‘swig.exe’ завершилась неудачно
  10. 5 ответов

pyscard installation via pip fails on win7 x64 (missing dependencys?) #55

i’m trying to install pyscard but pip installation fails. Seems like missing dependency’s(?)
OS Win 7-x64
Command: python -m pip install pyscard
Tested with Python 3.4.4-x64, 3.4.4-x86, 3.6.2-x64, 3.6.2-x86

Output from Pycharm

Output from CMD

1\AppData\Local\Temp\pi p-build-toq198jf\pyscard\setup.py’;f=getattr(tokenize, ‘open’, open)(__file__) ;code=f.read().replace(‘rn’, ‘n’);f.close();exec(compile(code, __file__, ‘exe c’))» install —record C:UsersLUCKYS

1AppDataLocalTemppip-4sq8kep9-record install-record.txt —single-version-externally-managed —compile: running install running build running build_py running build_ext building ‘smartcard.scard._scard’ extension swigging smartcard/scard/scard.i to smartcard/scard/scard_wrap.c swig.exe -python -outdir smartcard/scard -DWIN32 -o smartcard/scard/scard_wr ap.c smartcard/scard/scard.i error: command ‘swig.exe’ failed: No such file or directory Command «F:PythonPython3-4-4-x64python.exe -u -c «import setuptools, tokenize ;__file__=’C:\Users\LUCKYS

1\AppData\Local\Temp\pip-build-toq198jf\pyscar d\setup.py’;f=getattr(tokenize, ‘open’, open)(__file__);code=f.read().replace(‘ rn’, ‘n’);f.close();exec(compile(code, __file__, ‘exec’))» install —record C :UsersLUCKYS

1AppDataLocalTemppip-4sq8kep9-recordinstall-record.txt —sin gle-version-externally-managed —compile» failed with error code 1 in C:UsersL UCKYS

Swig.exe failed No such file or directory
I’ll guess this is some undocumented dependency?
http://www.swig.org/download.html This one? Which version?

The text was updated successfully, but these errors were encountered:

Источник

pyWinhook fails to build when installing PsychoPy 3.0.2 #2222

When performing developers install for PsychoPy 3.0.2 on Windows 10, the installation fails due to a pyWinhook build failure:

The text was updated successfully, but these errors were encountered:

Fixed by downloading SWIG and adding path of swig.exe to environment variables.

We previously didn’t have pyHook or pyWinhook listed as package requirements probably for this reason. : When py(Win)hook ‘s setup.py is called, it invokes swig to compile the C bindings.

For what it’s worth, I created conda packages, so in case you fancy using a conda environment, simply do conda install -c conda-forge pywinhook .

So this is not a bug, but simply the pyWinhook devs failing to provide wheels for modern Python distributions via PyPI, so pip is forced to compile it from source.

On another side node, you now probably ended up with a non-functional pyWinhook installation, as the latest release does not support Python 3… :S My conda package, however, contains the appropriate patch.

Luckily I didn’t change it in the standalone as far as I know (hoping it didn’t update and break itself automatically during build)!

(This was actually part of the things that made me wonder if we shouldn’t factor out the iohub deps into an extra , but there’s pros and cons for both approaches)

Luckily I didn’t change it in the standalone as far as I know (hoping it didn’t update and break itself automatically during build)!

If you installed it manually via a wheel or exe like always, I don’t think pip or setuptools would attempt to fetch / compile it again from the web, so all should be good I guess?

The pyWinhook maintainer has merged my PR adding Py3 support, and drafted a new release including wheels for Py 2.7 and 3.7: https://github.com/Tungsteno74/pyWinhook/releases/tag/1.6.0
Hope this will be published on PyPI soon.

I will try to build and upload a Py 3.6 build as well when I have time.

I believe this closes this issue!

Does this have any benefits over the pyHook that I was providing already? ie. Should I be updating the standalone to use this instead?

@peircej I don’t know where you acquired pyHook for Python 3, probably from https://www.lfd.uci.edu/

gohlke/pythonlibs/? Because there are no official releases supporting Py3. My patches have added Py3 support to pyWinhook and the maintainer published fresh wheels, so installing via PyPI should now be easier (no compilation required, at least for Py 3.7, but will add 3.6 soon too).

But to answer your question, I don’t think there would be much of a benefit for you to switch from pyHook to pyWinhook in standalone, as long as it works with Py3 anyway. – No benefit apart from you being able to pip install that dep for Py3 from PyPI and without compilation, that is.

Yes, I think I got it from gohlke
OK, will leave for now. thanks!

Py3.6 wheels now available from PyPI.

Meanwhile, pyWinhook 1.6.1 has been released. It contains fixes for unicode handling in window names, thereby providing an actual advantage over pyHook. Wheels for Python 2.7 and 3.7 are on PyPI, and I will publish Python 3.6 binaries tomorrow or so.

I am having problems installing PyWinHook using wheels. I get the following:

pyWinhook-1.6.0-cp36-cp36m-win_amd64.whl is not a supported wheel on this platform.

The installation from the developer repo also fails because the PyWinHook build fails for reason above (swig).

Using Windows 10 64-bit

There are currently no Py3.6 wheels for pyWinhook 1.6.1 on PyPI (only for 2.7 and 3.7). I can try to publish some later tonight. In the meantime, you could use pyWinhook 1.6.0.

Ah I see. No worries. I will switch to Py3.7 and go from there.

@dvbridges I just published a Py3.6 wheel on PyPI.

@hoechenberger @peircej I just tried to install psychopy using pip on Python 2.7 and I have exactly this issue

pip printed the following
Collecting pyWinhook (from psychopy) Downloading https://files.pythonhosted.org/packages/a7/ec/f3a1190aa76f59a20ef7b8b9aebd1c60ffd0a9d4c1b5a18ce27cc1b34ae0/pyWinhook-1.6.1.zip

So is there a way I can skip this requirement, or install it another way with a different version?

EDIT:
I have never heard of wheels before but I see they are easy to install

But I got the same thing .

pyWinhook-1.6.1-cp27-cp27m-win_amd64.whl is not a supported wheel on this platform.

I am also running Windows 10 64-bit but I have installed 32-bit python.

I ended up getting swig and VC++ for python

if anyone needs the wheel for pyWinhook 1.6.1 for Python 2.7 Windows 32-bit:
https://gist.github.com/mpratt14/67a7418900566e58391b9be01fdcc9b4

Just now I tried running pip install PsychoPy on a fresh 3.9 Python distribution, which at first failed because I didn’t have the latest Microsoft BuildTools installed. After having done it, only one error remains, which seems to be related to pyWinhook.

It seems like their latest release doesn’t have a 3.9 wheel. could that be the reason? is there any workaround that? Thanks!

Источник

Установка python-модуля pocketsphinx: команда ‘swig.exe’ завершилась неудачно

Я получаю что-то вроде этого. Может кто-нибудь, пожалуйста, скажите мне, как это исправить.

5 ответов

Чтобы исправить проблему, я скачал Swig для Windows

Скопируйте файл swig.exe в папку установки Python (например, C: /python27)

Откройте папку swigwin-3.0.12/Lib и скопируйте все файлы *.swg в C: /python27/lib или эквивалентный путь к python

Откройте swigwin-3.0.12/lib/python и скопируйте все файлы в (C: /python27/lib)

(Также убедитесь, что у вас установлен компилятор Microsoft Visual C++ для Python)

Эти шаги работали на меня.

Вы пытаетесь установить pocketsphinx с pip , который скачает и скомпилирует этот модуль. Требуется некоторый инструмент компиляции, такой как swig .

Другим решением является установка двоичной версии pocketsphinx . Вы можете скачать бинарную версию здесь. Вы должны выбрать правильную версию относительно вашей установки.

Чтобы определить, какую из них вы хотите загрузить, вы можете выполнить следующие команды, которые сообщат вам, какая версия вам нужна, и используете ли вы 32- или 64-битный интерпретатор Python.

Ниже приведены некоторые команды, которые вы можете ввести после загрузки правильной версии.

Вместо того, чтобы копировать файлы Swig в папку Python, вы можете просто добавить расположение Swig в переменные среды:

  1. Нажмите Ctrl+S
  2. Введите env и нажмите Enter
  3. Двойной щелчок по Path
  4. Добавьте путь к Swig к последней пустой строке
  5. Нажмите OK и перезагрузите компьютер

Источник

Failed building wheel for pocketsphinx #209

I install the anaconda3,and use pip install textract in the cmd window.
However, the install is incomplete. This causes other codes to have problems with its invocation.
The warning is as follows:

Building wheels for collected packages: pocketsphinx
Running setup.py bdist_wheel for pocketsphinx . error
Complete output from command C:UserswAnaconda3python.exe -u -c «import setuptools, tokenize;file=’C:UserswAppDataLocalTemppip-build-l78y971lpocketsphinxsetup.py’;f=getattr(tokenize, ‘open’, open)(file);code=f.read().replace(‘rn’, ‘n’);f.close();exec(compile(code, file, ‘exec’))» bdist_wheel -d C:UserswAppDataLocalTemptmplpi7yv4zpip-wheel- —python-tag cp36:
running bdist_wheel
running build_ext
building ‘sphinxbase._ad’ extension
swigging swig/sphinxbase/ad.i to swig/sphinxbase/ad_wrap.c
swig.exe -python -modern -Ideps/sphinxbase/include -Ideps/sphinxbase/include/sphinxbase -Ideps/sphinxbase/include/win32 -Ideps/sphinxbase/swig -outdir sphinxbase -o swig/sphinxbase/ad_wrap.c swig/sphinxbase/ad.i
error: command ‘swig.exe’ failed: No such file or directory

Failed building wheel for pocketsphinx
Running setup.py clean for pocketsphinx
Failed to build pocketsphinx
Installing collected packages: python-pptx, beautifulsoup4, six, EbookLib, chardet, docx2txt, xlrd, argcomplete, pocketsphinx, SpeechRecognition, textract
Found existing installation: beautifulsoup4 4.6.0
Uninstalling beautifulsoup4-4.6.0:
Successfully uninstalled beautifulsoup4-4.6.0
Found existing installation: six 1.11.0
Uninstalling six-1.11.0:
Successfully uninstalled six-1.11.0
Found existing installation: chardet 3.0.4
Uninstalling chardet-3.0.4:
Successfully uninstalled chardet-3.0.4
Found existing installation: xlrd 1.1.0
Uninstalling xlrd-1.1.0:
Successfully uninstalled xlrd-1.1.0
Running setup.py install for pocketsphinx . error
Complete output from command C:UserswAnaconda3python.exe -u -c «import setuptools, tokenize;file=’C:UserswAppDataLocalTemppip-build-l78y971lpocketsphinxsetup.py’;f=getattr(tokenize, ‘open’, open)(file);code=f.read().replace(‘rn’, ‘n’);f.close();exec(compile(code, file, ‘exec’))» install —record C:UserswAppDataLocalTemppip-rdnf9rb9-recordinstall-record.txt —single-version-externally-managed —compile:
running install
running build_ext
building ‘sphinxbase._ad’ extension
swigging swig/sphinxbase/ad.i to swig/sphinxbase/ad_wrap.c
swig.exe -python -modern -Ideps/sphinxbase/include -Ideps/sphinxbase/include/sphinxbase -Ideps/sphinxbase/include/win32 -Ideps/sphinxbase/swig -outdir sphinxbase -o swig/sphinxbase/ad_wrap.c swig/sphinxbase/ad.i
error: command ‘swig.exe’ failed: No such file or directory

Command «C:UserswAnaconda3python.exe -u -c «import setuptools, tokenize;file=’C:UserswAppDataLocalTemppip-build-l78y971lpocketsphinxsetup.py’;f=getattr(tokenize, ‘open’, open)(file);code=f.read().replace(‘rn’, ‘n’);f.close();exec(compile(code, file, ‘exec’))» install —record C:UserswAppDataLocalTemppip-rdnf9rb9-recordinstall-record.txt —single-version-externally-managed —compile» failed with error code 1 in C:UserswAppDataLocalTemppip-build-l78y971lpocketsphinx

The text was updated successfully, but these errors were encountered:

Источник

Установка модуля python для pocketsphinx: команда ‘swig.exe’ завершилась неудачно

Я получаю что-то вроде этого. Может кто-нибудь, пожалуйста, скажите мне, как это исправить.

5 ответов

Чтобы решить эту проблему, я загрузил глоток для окон

Скопируйте файл swig.exe в папку установки Python (например, C: / python27)

Откройте папку swigwin-3.0.12 / Lib и скопируйте все файлы * .swg в C: / python27 / lib или эквивалентный путь к python

Откройте swigwin-3.0.12 / lib / python и скопируйте все файлы в (C: / python27 / lib)

(Также убедитесь, что у вас установлен компилятор Microsoft Visual C ++ для Python)

Эти шаги сработали для меня.

Я не хотел делать всю эту настройку, которую предлагают другие люди, поэтому я попробовал это, и это сработало. Это, вероятно, работает, только если вы используете Anaconada.

Вы пытаетесь установить pocketsphinx с pip , который загрузит и скомпилирует этот модуль. Требуется некоторый инструмент компиляции, такой как swig .

Другое решение — установить двоичную версию pocketsphinx . Вы можете загрузить двоичную версию здесь. Вы должны выбрать правильную версию относительно вашей установки.

Чтобы определить, какую из них вы хотите загрузить, вы можете выполнить следующие команды, которые сообщат вам, какая версия вам нужна, и используете ли вы 32- или 64-битный интерпретатор Python.

Ниже приведены некоторые команды, которые вы можете ввести после загрузки правильной версии.

Я также получал ту же ошибку, при установке в Ubuntu 16.04 я выполнил следующие команды:

Существует несколько наборов команд для решения этой проблемы. Просто выполните их:

Источник

Tried to do pip install pyWinhook and…

× Running setup.py install for pyWinhook did not run successfully.

│ exit code: 1

╰─> [16 lines of output]

running install

running build

running build_py

creating build

creating buildlib.win-amd64-3.10

creating buildlib.win-amd64-3.10pyWinhook

copying pyWinhookaa hook.py -> buildlib.win-amd64-3.10pyWinhook

copying pyWinhookdoc.py -> buildlib.win-amd64-3.10pyWinhook

copying pyWinhookexample.py -> buildlib.win-amd64-3.10pyWinhook

copying pyWinhookHookManager.py -> buildlib.win-amd64-3.10pyWinhook

copying pyWinhook__init__.py -> buildlib.win-amd64-3.10pyWinhook

running build_ext

building ‘pyWinhook._cpyHook’ extension

swigging pyWinhook/cpyHook.i to pyWinhook/cpyHook_wrap.c

swig.exe -python -o pyWinhook/cpyHook_wrap.c pyWinhook/cpyHook.i

error: command ‘swig.exe’ failed: None

[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.

error: legacy-install-failure

× Encountered error while trying to install package.

╰─> pyWinhook

note: This is an issue with the package mentioned above, not pip.

hint: See above for output from the failure.

Any help?

using python 3.10.2

Я получаю что-то вроде этого. Может кто-нибудь, пожалуйста, скажите мне, как это исправить.

C:UserskrushDocumentsML using Python>pip install pocketsphinx
Collecting pocketsphinx
  Using cached pocketsphinx-0.1.3.zip
Building wheels for collected packages: pocketsphinx
  Running setup.py bdist_wheel for pocketsphinx: started
  Running setup.py bdist_wheel for pocketsphinx: finished with status 'error'
  Complete output from command C:UserskrushAnaconda3python.exe -u -c "import setuptools, tokenize;__file__='C:\Users\krush\AppData\Local\Temp\pip-build-cns2i_wb\pocketsphinx\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d C:UserskrushAppDataLocalTemptmp3tyvnl9wpip-wheel- --python-tag cp36:
  running bdist_wheel
  running build_ext
  building 'sphinxbase._ad' extension
  swigging swig/sphinxbase/ad.i to swig/sphinxbase/ad_wrap.c
  swig.exe -python -modern -Ideps/sphinxbase/include -Ideps/sphinxbase/include/sphinxbase -Ideps/sphinxbase/include/win32 -Ideps/sphinxbase/swig -outdir sphinxbase -o swig/sphinxbase/ad_wrap.c swig/sphinxbase/ad.i
  error: command 'swig.exe' failed: No such file or directory

  ----------------------------------------
  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: started
    Running setup.py install for pocketsphinx: finished with status 'error'
    Complete output from command C:UserskrushAnaconda3python.exe -u -c "import setuptools, tokenize;__file__='C:\Users\krush\AppData\Local\Temp\pip-build-cns2i_wb\pocketsphinx\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:UserskrushAppDataLocalTemppip-x5mxeczy-recordinstall-record.txt --single-version-externally-managed --compile:
    running install
    running build_ext
    building 'sphinxbase._ad' extension
    swigging swig/sphinxbase/ad.i to swig/sphinxbase/ad_wrap.c
    swig.exe -python -modern -Ideps/sphinxbase/include -Ideps/sphinxbase/include/sphinxbase -Ideps/sphinxbase/include/win32 -Ideps/sphinxbase/swig -outdir sphinxbase -o swig/sphinxbase/ad_wrap.c swig/sphinxbase/ad.i
    error: command 'swig.exe' failed: No such file or directory

    ----------------------------------------
Command "C:UserskrushAnaconda3python.exe -u -c "import setuptools, tokenize;__file__='C:\Users\krush\AppData\Local\Temp\pip-build-cns2i_wb\pocketsphinx\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:UserskrushAppDataLocalTemppip-x5mxeczy-recordinstall-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:UserskrushAppDataLocalTemppip-build-cns2i_wbpocketsphinx

5 ответов

Лучший ответ

Чтобы решить эту проблему, я загрузил глоток для окон

  1. Скопируйте файл swig.exe в папку установки Python (например, C: / python27)

  2. Откройте папку swigwin-3.0.12 / Lib и скопируйте все файлы * .swg в C: / python27 / lib или эквивалентный путь к python

  3. Откройте swigwin-3.0.12 / lib / python и скопируйте все файлы в (C: / python27 / lib)

(Также убедитесь, что у вас установлен компилятор Microsoft Visual C ++ для Python)

Эти шаги сработали для меня.


13

Pang
15 Янв 2019 в 01:00

conda install swig
pip install pocketsphinx

Я не хотел делать всю эту настройку, которую предлагают другие люди, поэтому я попробовал это, и это сработало. Это, вероятно, работает, только если вы используете Anaconada.


6

Jaideep Heer
28 Сен 2019 в 08:16

Вы пытаетесь установить pocketsphinx с pip, который загрузит и скомпилирует этот модуль. Требуется некоторый инструмент компиляции, такой как swig.

Другое решение — установить двоичную версию pocketsphinx. Вы можете загрузить двоичную версию здесь. Вы должны выбрать правильную версию относительно вашей установки.

Чтобы определить, какую из них вы хотите загрузить, вы можете выполнить следующие команды, которые сообщат вам, какая версия вам нужна, и используете ли вы 32- или 64-битный интерпретатор Python.

"C:UserskrushAnaconda3python.exe" --version
"C:UserskrushAnaconda3python.exe" -c "import struct;print(struct.calcsize('P') * 8)"

Ниже приведены некоторые команды, которые вы можете ввести после загрузки правильной версии.

"C:UserskrushAnaconda3python.exe" -m pip install pocketsphinx‑0.1.3‑cp35‑cp35m‑win32.whl
"C:UserskrushAnaconda3python.exe" -m pip install pocketsphinx‑0.1.3‑cp36‑cp36m‑win_amd64.whl


9

Guillaume Jacquenot
12 Июн 2017 в 19:23

Я также получал ту же ошибку, при установке в Ubuntu 16.04 я выполнил следующие команды:

sudo apt-get install -y python python-dev python-pip build-essential swig git libpulse-dev

sudo pip install pocketsphinx

Источник: pocketsphinx-python


2

Ramesh Kumar
12 Сен 2018 в 11:33

Существует несколько наборов команд для решения этой проблемы. Просто выполните их:

sudo apt-get install -y python3 python3-dev python3-pip build-essential swig git libpulse-dev

sudo apt-get install libasound2-dev

sudo pip install pocketsphinx


0

Nitish nagar
29 Апр 2019 в 07:19

  • Summary

  • Files

  • Reviews

  • Support

  • Mailing Lists

  • Tickets ▾

    • Patches
    • Feature Requests
    • Bugs
  • News

  • Discussion

  • Donate

  • Code

Menu

Setting up in Windows 7 using Anaconda


Creator:

ET

Created:

2014-04-20

Updated:

2015-06-12

  • ET

    I am presently making the switch from Matlab to Python (it has been great until now). Unfortunately, I am now in over my head: I want to implement some simple nonlinear dynamical systems (with some bifurcation analysis). I can do the numerical simulations easily (if slowly) in Matlab, but really want to start doing it in Python for a presentation in two weeks, and want to use PyDSTool (which, from the outside, looks fantastic).

    Has anyone written up anything on getting PyDSTool working in the Anaconda environment in Windows 7?

    Unfortunately, I am not a hacker, and my initial attempts to get PyDSTool working have yielded a fail. I have been (probably incorrectly) following the instructions here:
    http://www2.gsu.edu/~matrhc/GettingStarted.html#head-607f3c0ee247904b85ccb5001f8b0a7ff13392f6

    But frankly I am such a noob I am not sure of all the dependencies, or even if my Python can see my c compiler. I feel I am lost in a labyrinth and will spend the next two weeks in installation hell, which I unfortunately don’t have time for right now (but I feel like it’s giving in to just do it the easy way in Matlab). Any help anyone can give me I would greatly appreciate it.

    So far I have extracted the PyDSTool folder to C:, added PyDSTool to my Python path, and then (from within the test directory in PyDSTool) I ran the test in the iPython shell with:
    run run_all_tests.py

    And every test failed.

    System info: I am on Windows 7 with Anaconda 1.9.1 (using Spyder/ipython), and use mingw.

    I can switch to Ubuntu, which I already have installed, if I absolutely must, to get this working quickly (though frankly, from my non-hacker eyes, the install instructions look just as complicated at the above site for Linux as for Windows; and I prefer Windows 7 to Ubuntu).

    Cross-posted at:
    https://groups.google.com/a/continuum.io/d/msg/anaconda/IuedB6u54Vc/xky3fofL3DsJ

  • Rob Clewley

    Hi,

    Here are slightly more current instructions at the site linked to from the main project site. But the main issue is probably the same, regardless. If not one test runs then your system is probably still not seeing PyDSTool. But, is it at least seeing numpy and scipy? When you start iPython, can you successfully run «import numpy» for instance?

    If not, then you have larger configuration problems with Python. What version of Python did you install? The current release of PyDSTool is not yet compatible with Python 3.x but our beta release is, which I can point you to at a separate location. It could also be that you need to deactivate User Account Control (used to be a problem on Vista) before installing Anaconda and, if so, instructions are given on my page linked above.

    Additionally, it sounds like you maybe did only one of the following. You have to edit a PyDSTool.pth file and put it in Python’s site-packages folder. You also have to edit the Windows Environment Variable (Control Panel -> System) to add PyDSTool to the Python PATH variable.

    Just try typing «import PyDSTool» from the iPython prompt. Once that works, PyDST is visible, and all the basic tests should then run. We can then talk about mingw in case gcc is not visible for the Dopri/Radau/AUTO tests. But if you can type «gcc —version» anywhere at a command prompt then you should be good to go.

  • ET

    Thanks so much for the help! I made the changes you suggested (in particular, for Anaconda, the path file goes into C:AnacondaLibsite-packages), and now don’t get an error when I import PyDSTool, and the tests seem to be running (with a gorgeous graph of some action potentials). I will post details later once the tests finish (some of the tests seem to be failing, but many seem to be working!).

    I am so pumped thank you so much for the quick help!

    (Incidentally I am using Python 2.7, and within Anaconda, numpy, scipy, matplotlib are integrated pretty well into the environment so that wasn’t the issue—the main changes were in the .pth file and environment variable, neither of which I had done correctly).

     

    Last edit: ET 2014-04-20

  • ET

    The tests all ran, and quite a few seemed to pass, but a lot failed as well. Below is the output when I ran run_all_tests.py (note also gcc is seen by my system: typing in ‘gcc —version’ yields reasonable output):

    Test scripts that failed:
    test_pointsets.py
    SLIP_2D_maps.py
    poly_interp_test.py
    fingermodel_vode.py
    test_hybrid_extinputs.py
    IF_squarespike_model.py
    IF_delaynet.py
    forced_spring.py
    pest_test3.py
    PyCont_DiscPredPrey.py
    PyCont_Hopfield.py
    PyCont_hybrid_osc.py
    imprecise_event_test.py
    interp_dopri_test.py
    dopri_event_test.py
    HH_model_Cintegrator.py
    HH_loaded_Cintegrator.py
    IF_delaynet_syn.py
    CIN.py
    HH_model_Cintegrator_testbounds.py
    Dopri_backwards_test.py
    test_hybrid_extinputs_Cintegrator.py
    SLIP_2D_pdc.py
    DAE_example.py
    radau_event_test.py
    freefinger_noforce_radau.py
    sloppycell_example.py
    pest_test3_Cintegrator.py
    pest_test4_Cintegrator.py
    PyCont_MorrisLecar_TypeI.py
    PyCont_MorrisLecar_TypeII.py
    PyCont_LPNeuron.py
    PyCont_HindmarshRose.py
    Summary:
    Basic PyDSTool functions: appears to be broken on your system
    Map related modules: appears to be broken on your system
    VODE related modules: appears to be broken on your system
    Symbolic differentiation module: appears to work on your system
    Parameter estimation module: appears to be broken on your system
    PyCont: appears to be broken on your system
    Dopri ODE systems: appears to be broken on your system
    Radau ODE systems: appears to be broken on your system
    Parameter estimation module with external compilers: appears to be broken on your system
    PyCont interface to AUTO: appears to be broken on your system

  • Rob Clewley

    OK, we’re making progress then. But some of the basic tests are failing, which is very unusual. Please run «test_pointsets» and «test_hybrid_extinputs» by hand and post the logs so that I can see what is wrong. It’s possibly something fundamental, like a library version incompatibility. Did you check that numpy, scipy, and matplotlib all import OK by hand at the prompt? Please also list the exact versions of your Python and these three libraries. If they import, then numpy.__version__ etc. is the way to find these. Thanks.

     

    Last edit: Rob Clewley 2014-04-21

  • ET

    *Did you check that numpy, scipy, and matplotlib all import OK by hand at the prompt?

    They import without complaint.

    *Please also list the exact versions of your Python and these three libraries.

    Python: 2.7.6 (distributed with Anaconda 1.9.1 (64 bit))
    iPython: version 1.1.0
    Numpy: 1.8.0
    matplotlib: 1.3.1
    scipy: 0.13.3

    *Please run «test_pointsets»

    Below are the last few lines of the log, and the stack trace. I will do same for test_hybrid_extinputs in my next response.

    We can test equality between arrays, as usual:
    w_at_1 != wp(1.).toarray() => [ True True True]
    We can also compare with a Pointset object:
    wp(1.) != w_at_1 => [ True True True]
    But we can’t put an array on the left-hand side if a Point or Pointset is on the right.

    To demonstrate appending a Point and Pointset to another Pointset:
    vw.labels —> 1: {c: {}}
    wp.append(vw)
    Traceback (most recent call last):

    File «<ipython-input-35-f8ecbaa2bb3c>», line 1, in <module>
    runfile(‘C:/PyDSTool/tests/test_pointsets.py’, wdir=’C:/PyDSTool/tests’)

    File «C:Anacondalibsite-packagesspyderlibwidgetsexternalshellsitecustomize.py», line 540, in runfile
    execfile(filename, namespace)

    File «C:/PyDSTool/tests/test_pointsets.py», line 151, in <module>
    wp.append(vw)

    File «C:PyDSToolPoints.py», line 1516, in append
    p_labels.mapIndices(dict(zip(pixs, [i+old_len for i in pixs])))

    File «C:PyDSToolPoints.py», line 1819, in mapIndices
    self.init(by_index)

    File «C:PyDSToolPoints.py», line 1801, in init
    raise TypeError(«Initialization dictionary must be keyed «

    TypeError: Initialization dictionary must be keyed by integer indices

     

    Last edit: ET 2014-04-20

  • ET

    Output/stack trace for test_hybrid_extinputs:

    t0= 89.1061093019 traj.globalt0= 89.1061093019
    traj.indepdomain = [0.0, 10.893890698109843]
    x: Interval traj_indep_bd [-inf, inf]
    state: Interval traj_indep_bd [-inf, inf]
    inval: Interval traj_indep_bd [-inf, inf]
    Last point of traj test1_8 was: inval: 1.35843140758
    state: 1.0
    x: -2.42614999371
    Warnings: Warning code 21: State or input variable reached bounds (non-terminal)
    Info: t = 100.0, var name = in, var value = None,
    value interval = [-2.9835545266604599, 1.7633274729942017] Warning code 21: State or input variable reached bounds (non-terminal)
    Info: t = 100.0, var name = in, var value = None,
    value interval = [-2.9835545266604599, 1.7633274729942017]
    End reason in test_inputs was [‘time’]
    Traceback (most recent call last):

    File «<ipython-input-36-c868c41bd158>», line 1, in <module>
    runfile(‘C:/PyDSTool/tests/test_hybrid_extinputs.py’, wdir=’C:/PyDSTool/tests’)

    File «C:Anacondalibsite-packagesspyderlibwidgetsexternalshellsitecustomize.py», line 540, in runfile
    execfile(filename, namespace)

    File «C:/PyDSTool/tests/test_hybrid_extinputs.py», line 118, in <module>
    plotData = test1(m)

    File «C:/PyDSTool/tests/test_hybrid_extinputs.py», line 96, in test1
    return m.sample(‘test1’)

    File «C:PyDSToolModel.py», line 1339, in sample
    doEvents, precise)

    File «C:PyDSToolTrajectory.py», line 1440, in sample
    pset.append(pset_new, skipMatchingIndepvar=True)

    File «C:PyDSToolPoints.py», line 1514, in append
    p_labels.mapIndices(dict(zip(pixs, [i+old_len-1 for i in pixs])))

    File «C:PyDSToolPoints.py», line 1819, in mapIndices
    self.init(by_index)

    File «C:PyDSToolPoints.py», line 1801, in init
    raise TypeError(«Initialization dictionary must be keyed «

    TypeError: Initialization dictionary must be keyed by integer indices

  • Rob Clewley

    That is strange that you get this error on the same versions that I’m running with no problem. Can you try substituting your PyDSTool/Points.py file with the most up-to-date one here
    on our github repo. If that gives the same error, I’ll devise a diagnostic test file that you can try to see where the issue is coming from.

  • ET

    I seem to get the same error with the new Points.py file:


    We can test equality between arrays, as usual:
    w_at_1 != wp(1.).toarray() => [ True True True]
    We can also compare with a Pointset object:
    wp(1.) != w_at_1 => [ True True True]
    But we can’t put an array on the left-hand side if a Point or Pointset is on the right.

    To demonstrate appending a Point and Pointset to another Pointset:
    vw.labels —> 1: {c: {}}
    wp.append(vw)
    Traceback (most recent call last):

    File «<ipython-input-37-f8ecbaa2bb3c>», line 1, in <module>
    runfile(‘C:/PyDSTool/tests/test_pointsets.py’, wdir=’C:/PyDSTool/tests’)

    File «C:Anacondalibsite-packagesspyderlibwidgetsexternalshellsitecustomize.py», line 540, in runfile
    execfile(filename, namespace)

    File «C:/PyDSTool/tests/test_pointsets.py», line 151, in <module>
    wp.append(vw)

    File «C:PyDSToolPoints.py», line 1516, in append
    self.indepvararray.resize(new_len)

    File «C:PyDSToolPoints.py», line 1819, in mapIndices
    for label, infodict in v.iteritems():

    File «C:PyDSToolPoints.py», line 1801, in init
    if ptlabels is None:

    TypeError: Initialization dictionary must be keyed by integer indices


    Thanks again for going out of your way to help me with this…

     

    Last edit: ET 2014-04-21

  • Rob Clewley

    No problem! Weird things sometimes come up and it helps us make the code more robust when there is sometimes an emerging problem with new library versions. So it’s very helpful to us. Here’s what to do: please edit the new Points.py in a code editor. In front of the existing line 1812 («if not isinstance(k, _int_types):») add the code «print ‘Type is’, type(k)». Please report the result that will show right before the same traceback. I have a theory that this won’t be a big problem to fix. To test this, you might as well go right ahead and put comment characters in front of that whole ‘if’ statement that raises the TypeError, and see if the two test files run successfully (then see if the others do too). I’ll get back to you later with a fix if it’s what I think it might be…

  • ET

    Here’s what I get when I add «print «ET db check: Type is», type(k)» to the code:


    To demonstrate appending a Point and Pointset to another Pointset:
    ET db check: Type is type ‘int’
    vw.labels —> 1: {c: {}}
    wp.append(vw)
    ET db check: Type is type ‘int’
    ET db check: Type is type ‘long’
    Traceback (most recent call last):

    File «<ipython-input-7-f8ecbaa2bb3c>», line 1, in <module>
    runfile(‘C:/PyDSTool/tests/test_pointsets.py’, wdir=’C:/PyDSTool/tests’)

    File «C:Anacondalibsite-packagesspyderlibwidgetsexternalshellsitecustomize.py», line 540, in runfile
    execfile(filename, namespace)

    File «C:/PyDSTool/tests/test_pointsets.py», line 151, in <module>
    wp.append(vw)

    File «C:PyDSToolPoints.py», line 1528, in append
    p_labels.mapIndices(dict(zip(pixs, [i+old_len for i in pixs])))

    File «C:PyDSToolPoints.py», line 1832, in mapIndices
    self.init(by_index)

    File «C:PyDSToolPoints.py», line 1814, in init
    raise TypeError(«Initialization dictionary must be keyed «

    TypeError: Initialization dictionary must be keyed by integer indices


    When I comment out the bit that raises the TypeError exception, I get the following:


    To demonstrate appending a Point and Pointset to another Pointset:
    ET db check: Type is type ‘int’
    vw.labels —> 1: {c: {}}
    wp.append(vw)
    ET db check: Type is type ‘int’
    ET db check: Type is type ‘long’
    Traceback (most recent call last):

    File «<ipython-input-2-f8ecbaa2bb3c>», line 1, in <module>
    runfile(‘C:/PyDSTool/tests/test_pointsets.py’, wdir=’C:/PyDSTool/tests’)

    File «C:Anacondalibsite-packagesspyderlibwidgetsexternalshellsitecustomize.py», line 540, in runfile
    execfile(filename, namespace)

    File «C:/PyDSTool/tests/test_pointsets.py», line 151, in <module>
    wp.append(vw)

    File «C:PyDSToolPoints.py», line 1529, in append
    self.labels.update(p_labels)

    File «C:PyDSToolPoints.py», line 2006, in update
    self.update(k, vk, vv)

    File «C:PyDSToolPoints.py», line 2053, in update
    raise TypeError(«Invalid type for update»)

    TypeError: Invalid type for update


  • Rob Clewley

    That’s OK, it is actually what I suspected though. It’s about the occurrence of the «long» integer on 64 bit platforms. We have only done limited testing in 64 bit environments and for some reason yours is not happy when other 64 bit systems have tested fine. So see if this quick fix works, please. Restore the «if» statement and delete the new «print» statement. In PyDSTool/common.py, around line 102, make the line read thus:

    _int_types = (int, integer, long)
    

    We’ll look into this issue more carefully in the meantime. Thanks for your patience!

  • ET

    It worked! I’m now running run_all_tests again will post output here.

  • ET

    Output of run_all_tests, I’m going to go ahead and run test_interval by hand.


    Test scripts that failed:
    test_interval.py
    poly_interp_test.py
    pest_test3.py
    PyCont_ABCReaction.py
    PyCont_Hopfield.py
    imprecise_event_test.py
    interp_dopri_test.py
    dopri_event_test.py
    HH_model_Cintegrator.py
    HH_loaded_Cintegrator.py
    CIN.py
    HH_model_Cintegrator_testbounds.py
    Dopri_backwards_test.py
    test_hybrid_extinputs_Cintegrator.py
    SLIP_2D_pdc.py
    DAE_example.py
    radau_event_test.py
    freefinger_noforce_radau.py
    sloppycell_example.py
    pest_test3_Cintegrator.py
    pest_test4_Cintegrator.py
    PyCont_MorrisLecar_TypeI.py
    PyCont_MorrisLecar_TypeII.py
    PyCont_LPNeuron.py
    PyCont_HindmarshRose.py
    Summary:
    Basic PyDSTool functions: appears to be broken on your system
    Map related modules: appears to work on your system
    VODE related modules: appears to be broken on your system
    Symbolic differentiation module: appears to work on your system
    Parameter estimation module: appears to be broken on your system
    PyCont: appears to be broken on your system
    Dopri ODE systems: appears to be broken on your system
    Radau ODE systems: appears to be broken on your system
    Parameter estimation module with external compilers: appears to be broken on your system
    PyCont interface to AUTO: appears to be broken on your system

  • ET

    Some outputs…

    poly_interp_test:

    File «C:/PyDSTool/tests/poly_interp_test.py», line 34, in <module>
    traj = s.compute(‘test’)

    File «C:PyDSToolGeneratorVode_ODEsystem.py», line 686, in compute
    interp = PiecewisePolynomial(alltData, xvals, 2)

    File «C:PyDSToolcommon.py», line 2717, in init
    self.extend(xi[1:],yi[1:],orders)

    File «C:PyDSToolcommon.py», line 2816, in extend
    self.append(xi[i],yi[i],orders)

    File «C:PyDSToolcommon.py», line 2792, in append
    order, self.direction))

    File «C:PyDSToolcommon.py», line 2750, in _make_polynomial
    return KroghInterpolator(xi,yi)

    File «C:PyDSToolcommon.py», line 2338, in init
    Vk[0] = yi[k]/float(spy.factorial(s))

    AttributeError: ‘module’ object has no attribute ‘factorial’


    imprecise_event_test:

    File «C:/PyDSTool/tests/imprecise_event_test.py», line 33, in <module>
    ode = Generator.Dopri_ODEsystem(DSargs)

    File «C:PyDSToolGeneratorDopri_ODEsystem.py», line 421, in init
    self.compileLib()

    File «C:PyDSToolGeneratorDopri_ODEsystem.py», line 795, in compileLib
    raise RuntimeError

    RuntimeError


    And dopri_event_test:

    File «C:/PyDSTool/tests/dopri_event_test.py», line 58, in <module>
    testODE = Dopri_ODEsystem(DSargs)

    File «C:PyDSToolGeneratorDopri_ODEsystem.py», line 421, in init
    self.compileLib()

    File «C:PyDSToolGeneratorDopri_ODEsystem.py», line 795, in compileLib
    raise RuntimeError

    RuntimeError

  • Rob Clewley

    We’re overdue for a new SF release anyway, which will fix some of these errors, but scipy’s factorial function is now in the ‘misc’ sub-module. So, file «C:PyDSToolcommon.py», line 2338 should have ‘spy.misc.factorial’

    For the other, it’s possibly just that you didn’t remove the «-m32» flags as per the Getting Started instructions for C-based integrators (sorry, this has been automated in the upcoming release!). If not, it will probably be an unresolved 64-bit issue that has been difficult for us to solve. If you ran it by hand, there should be more text above the error message that is a report from gcc or the linker about what gcc command it ran and what its own error message is.

    But I’d still like to see why test_interval and pest_test3 failed, please.

  • ET

    OK poly_interp_test worked after getting the factorial right!


    I then removed the -m32 flags in Dopri_ODEsystem.py, Radau_ODEsystem.py and ContClass.py files. Running the other scripts (and test_interval/pest_test), I got the following…


    imprecise_event_test:

    File «C:/PyDSTool/tests/imprecise_event_test.py», line 33, in <module>
    ode = Generator.Dopri_ODEsystem(DSargs)

    File «C:PyDSToolGeneratorDopri_ODEsystem.py», line 421, in init
    self.compileLib()

    File «C:PyDSToolGeneratorDopri_ODEsystem.py», line 795, in compileLib
    raise RuntimeError

    RuntimeError


    dopri_event_test:

    File «C:/PyDSTool/tests/dopri_event_test.py», line 58, in <module>
    testODE = Dopri_ODEsystem(DSargs)

    File «C:PyDSToolGeneratorDopri_ODEsystem.py», line 421, in init
    self.compileLib()

    File «C:PyDSToolGeneratorDopri_ODEsystem.py», line 795, in compileLib
    raise RuntimeError

    RuntimeError


    test_interval:
    r=Interval(‘another_singleton’, float, 0.0)
    b=Interval(‘b’, int, 0)
    b in m => UncertainValueError: ‘cannot determine membership (uncertain) at variable = Interval b’
    i=Interval(‘i’, int, (0,1))
    b in i => True (true because we’re comparing integer intervals)
    Traceback (most recent call last):

    File «<ipython-input-3-74f3e1c211c9>», line 1, in <module>
    runfile(‘C:/PyDSTool/tests/test_interval.py’, wdir=’C:/PyDSTool/tests’)

    File «C:Anacondalibsite-packagesspyderlibwidgetsexternalshellsitecustomize.py», line 540, in runfile
    execfile(filename, namespace)

    File «C:/PyDSTool/tests/test_interval.py», line 70, in <module>
    assert i.contains(1) is contained # because discrete-valued interval

    AssertionError


    pest_test3.py:

    […]
    -5.14622718e-01 -6.62716325e-01 -7.70728160e-01 -7.72288722e-01
    -2.57780966e-03 -1.39670715e-01]
    *** CHOSE pars with residual 7.64717851
    Feature evaluation on solution set-up: False
    geom feat residual: 76.4585250118

    Preparing plots
    Valid coordinate names: [‘sptime’, ‘spval’]
    C:Anacondalibsite-packagessklearnpls.py:7: DeprecationWarning: This module has been moved to cross_decomposition and will be removed in 0.16
    «removed in 0.16», DeprecationWarning)
    <matplotlib.figure.Figure at=»» 0x14494080=»»>
    Traceback (most recent call last):

    File «<ipython-input-4-29d3f0dd2068>», line 1, in <module>
    runfile(‘C:/PyDSTool/tests/pest_test3.py’, wdir=’C:/PyDSTool/tests’)

    File «C:Anacondalibsite-packagesspyderlibwidgetsexternalshellsitecustomize.py», line 540, in runfile
    execfile(filename, namespace)

    File «C:/PyDSTool/tests/pest_test3.py», line 227, in <module>
    plotData_par = sol_traj.sample([‘v’])

    File «C:PyDSToolTrajectory.py», line 554, in sample
    res = self.call([self.indepdomain.get()], coords_sorted)

    File «C:PyDSToolTrajectory.py», line 351, in call
    raise ValueError(«Invalid coordinate names passed»)

    ValueError: Invalid coordinate names passed

  • Rob Clewley

    OK, the non-gcc related problems are minor and are fixed in the upcoming release. They shouldn’t stand in your way for now. If the interval issue bites in your own code for any reason, then just update common.py from here.

    You still need to post the full gcc call and error output that you should see above the traceback for those other tests. If it’s not visible on your configuration of ipython try running the test using native python:

    python dopri_event_test.py

  • ET

    Ah yes ipython wasn’t showing that…from command line I see swig is not installed. That’s rather embarassing. Working on it now. One thing I got hung up on as I looked at this earlier, is I cannot find my autoexec.bat file in Windows 7. :O

     

    Last edit: ET 2014-04-21

  • ET

    I tried the following to get swig working….


    I extracted swig, added the folder with swig.exe to my python path as well as my system path.

    Then I set the environmental variables:

    PYTHON_INCLUDE: C:Anacondainclude (this contains Python.h)
    PYTHON_LIB:C:Anacondalibspython27.lib (this is the library for linking?)

    I then restarted my computer, and when I ran it in shell mode got the following:

    c:> python dopri_event_test.py

    Error occurred in generating Dopri system…
    <type ‘exceptions.SystemExit’=»»> error: command ‘swig.exe’ failed: No such file or
    directory
    Traceback (most recent call last):
    File «dopri_event_test.py», line 58, in <module>
    testODE = Dopri_ODEsystem(DSargs)
    File «C:PyDSToolGeneratorDopri_ODEsystem.py», line 421, in init
    self.compileLib()
    File «C:PyDSToolGeneratorDopri_ODEsystem.py», line 795, in compileLib
    raise RuntimeError
    RuntimeError


    For some reason, swig is not being recognized. Ugh.

  • Rob Clewley

    Try plain

    c:> swig

    (or is it ‘swig.exe’ on Windows? I’m forgetting right now). If it’s correctly on the system PATH, this should return an error that there is no input file (or similar). But I suspect that if PyDSTool cannot see it then this test will not work either. Are you sure the bin/ folder containing swig.exe is appended to the system path using Control Panel -> System? Because if it is, then a restarted shell should let you access swig from any directory. Beyond that, your guess is as good as mine :/

  • ET

    Ah I forgot I tweaked something and didn’t restart my shell….

    Just restarted it and got:


    C:PyDSTooltests> python dopri_event_test.py
    Looking for python27.dll
    Cannot build msvcr library: «msvcr90d.dll» not found
    Found executable C:AnacondaScriptsgcc.bat

    Error occurred in generating Dopri system
    (while moving library extension modules to CWD)
    <type ‘exceptions.IOError’=»»> [Errno 2] No such file or directory: ‘C:PyDSTool
    testsdopri853_tempsrc.win32-2.7dopri853_tempdop853_event_test_vf.py’
    Traceback (most recent call last):
    File «dopri_event_test.py», line 58, in <module>
    testODE = Dopri_ODEsystem(DSargs)
    File «C:PyDSToolGeneratorDopri_ODEsystem.py», line 421, in init
    self.compileLib()
    File «C:PyDSToolGeneratorDopri_ODEsystem.py», line 841, in compileLib
    raise RuntimeError
    RuntimeError

     

    Last edit: ET 2014-04-21

  • ET

  • Maurizio De Pitta'

     

    Last edit: Maurizio De Pitta’ 2014-05-15

  • Rob Clewley

    Just to follow up to concerned parties: I have verified myself that it is not possible to use the C integrators etc. on 64-bit Windows 7 with Anaconda, Pyzo, Python(x,y) etc. See https://gehrcke.de/2015/02/how-to-set-up-a-64-bit-version-of-numpy-on-windows/. Basically, although those systems have gotten numpy to «work» for normal usage, they have done so by compiling everything through the MSVC compiler. This prevents distutils from having access to the appropriate C header files that can be linked when PyDSTool tries to build C-based vector fields using GCC. This is the source of the gcc errors about definitions of «long long» and «uint64», which are far from easy to overcome by hand.

    The only solution for a regular user is to get hold of a compatible MSVC compiler and coercing distutils to use that (see PyDSTool docs for info about adding a compiler flag for distutils) or wait until numpy becomes properly compatible with 64-bit windows.


Log in to post a comment.

Понравилась статья? Поделить с друзьями:

Читайте также:

  • Error command swig exe failed no such file or directory
  • Error command start not found
  • Error command sh c node scripts build js
  • Error command seed not found
  • Error command returned non zero exit status 1

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии