Setting up Flow with Aimsun (examples/sugiyama.py) - python

I can't seem to open examples/aimsun/sugiyama.py
I have installed Aimsun Next 8.4.0 and I have already pasted its path in AIMSUN_NEXT_PATH variable in flow/config.py
Here's the error that I get;
OSError: [Errno 8] Exec format error:
'/home/daremapua/Aimsun_Next_8_4_0/Aimsun_Next'

I've just encountered the same today. What worked for me was to use Aimsun 8.3.1 instead. I'll try to find out what's the issue with 8.4.

Related

FileNotFoundError [Errno 2] when running pyinstaller executable?

I am trying to make my python file as an executable using Pyinstaller. After the process of conversion has finished, in my dist folder, when I click on "myApplication.exe" I get the following error:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\user\\Desktop\\Application\\dist\\myApplication\\smart_open\\VERSION'
[17416] Failed to execute script myApplication
I've already searched for answers to this but none of them have the specific error as mine which is the folder smart_open\VERSION as I have no idea what that's supposed to be.
EDIT
The smart_open folder does not even exists in my myApplication folder
Instead of using the original version of "smart_open" use this fork of the library: https://github.com/rs-trevor/smart_open
The pull request is here: https://github.com/RaRe-Technologies/smart_open/pull/344
It essentially converts the strange (extension-less) "VERSION" file into "version.py" so pyinstaller picks it up correctly
I encountered the same issue posted it within the smart_open github: https://github.com/RaRe-Technologies/smart_open/issues/345
I think you have to add the VERSION file of smart_open in the spec file. More information in the documentation.
Edit
In this case, datas line should be:
datas=[ ('c:\\python360564\\lib\\site-packages\\smart_open\\VERSION', 'smart_open\\VERSION' )],
The first part is the initial path of the file and the second the destination path (get from the error message).

How to add whl file on pip requirements files?

Assuming you created a whl of a proprietary project and would like to reuse it in another python project, how to indicate it via a relative path in a pip file without exposing whl online?
Although there is no direct description for this problem, from the documentation (https://pip.readthedocs.io/en/1.1/requirements.html) I have tried the following:
Indicate using -e file:
./folder/my-project-0.1.0-cp36-cp36m-linux_x86_64.whl#egg=my-project==0.1.0
got> NotADirectoryError: [Errno 20] Not a directory
Indicate using file:
./folder/my-project-0.1.0-cp36-cp36m-linux_x86_64.whl#egg=my-project==0.1.0
got> FileNotFoundError: [Errno 2] No such file or directory:
'/folder/my-project-0.1.0-cp36-cp36m-linux_x86_64.whl'
It seems to seek the file on the root folder instead of the relative one.
Indicate without file:
folder/my-project-0.1.0-cp36-cp36m-linux_x86_64.whl got> Invalid
requirement: 'folder/my-project-0.1.0-cp36-cp36m-linux_x86_64.whl'
It looks like a path. Does it exist ?
It appears that if I indicate the folder instead it will work.
But as this is not the case, does anyone know how to fix it?
numpy
pandas
file:./folder/my-project-0.1.0-cp36-cp36m-linux_x86_64.whl#egg=my-project==0.1.0
Pip install whl file using relative path with success!

AttributeError: module 'os' has no attribute 'chroot'

Below is my very basic code running in spyder & python is choking, what am I doing wrong?
import csv,os,sys
path = os.getcwd()
print (path)
os.chroot(path)
I get following error message:
os.chroot(path)
AttributeError: module 'os' has no attribute 'chroot'
One possibility is that your operating system is Microsoft Windows, for which os.chroot() is not available.
Did you name your file os.py? If you did, it is shadowing the stdlib os module. Change the name of your file and delete os.pyc or __pycache__.
Do print os or similar inside the script to see the file path Python is using to get the os module.
I have checked your code, and there is no any ERROR
but i see this message:
PermissionError: [Errno 1] Operation not permitted: '/home/beenj/Documents'
means we must run python3 with sudo ==> sudo python3
then enter above code...
or run compiled Python application (after completing ) in SuperUserDO (sudo)

ipython notebook lost after deleting a folder

My ipython notebook was in a given folder that I deleted from the terminal in the same time, and he get lost.
doing pwd or cd gives me :
OSError: [Errno 2] No such file or directory
ERROR: Internal Python error in the inspect module.
Below is the traceback from this internal error.
Unfortunately, your original traceback can not be constructed.
How can I solve this without restartint the kernel ? (which I guess will solve the problem.)
Problem solved :
import os
os.chdir("/Full/path/from/root/to/my/existing/folder")

pip fails to install PIL or Pillow with mt.exe error

On one of my Windows 7 development machines, I am attempting to install the Python Image Library.
My machines are similar. Both run Windows 7 Professional, x64. Both use Python 2.7.3 (32bit). On one of the machine pip install PIL works fine. On the other it fails with the trace ending with this:
build\temp.win-amd64-2.7\Release\_imaging.pyd.manifest : general error c1010070:
Failed to load and parse the manifest. The system cannot find the file specified.
error: command 'mt.exe' failed with exit status 31
How can I resolve this error?
Thanks to http://bugs.python.org/issue4431, this error was fixed by modifying:
C:\<Python dir>\Lib\distutils\msvc9compiler.py
and adding:
ld_args.append('/MANIFEST')
after the MANIFESTFILE line so it looks like:
# Embedded manifests are recommended - see MSDN article titled
# "How to: Embed a Manifest Inside a C/C++ Application"
# (currently at http://msdn2.microsoft.com/en-us/library/ms235591(VS.80).aspx)
# Ask the linker to generate the manifest in the temp dir, so
# we can embed it later.
temp_manifest = os.path.join(
build_temp,
os.path.basename(output_filename) + ".manifest")
ld_args.append('/MANIFESTFILE:' + temp_manifest)
ld_args.append('/MANIFEST')
If you still get the error, then change the if arg.startswith("/MANIFESTFILE:") to if arg.startswith("/MANIFEST:") in the manifest_get_embed_info(self, target_desc, ld_args) method.
Download the compressed package from pypi, and try building and installing in your machine. This link could give you some hints. That exactly deals with your problem only but the installation varies.
If you've reached here looking for
general error c1010070:
Failed to load and parse the manifest. The system cannot find the file specified.
error: command 'mt.exe' failed with exit status 31
Here's a workaround that worked in Windows 8/x64/Python 3.3/VS 11:
# py 3.3 seems to be compiled against VS 2010 compiler, force using VS11 cl.exe for us
$env:VS100COMNTOOLS=$env:VS110COMNTOOLS
# Modify C:\Python33\lib\distutils\msvc9compiler.py
# Comment line 670: ld_args.append('/MANIFESTFILE:' + temp_manifest)
# Basically it will instruct build to not look for manifest file

Categories