error after build with innosetup - python-2.7

i wrote a program in python
and i make a setup file with innosetup.after install my exe file and rum my installed program i got error:
Traceback (most recent call last):
File "ProductionRules.py", line 3, in <module>
File "zipextimporter.pyo", line 82, in load_module
File "nltk\__init__.pyo", line 40, in <module>
TypeError: unsupported operand type(s) for +=: 'NoneType' and 'str'
this error does not happen when i run my "ProductionRules.py" before converting to exe.
what should i do ?
please help me.

Related

"configparser.DuplicateOptionError" when running AWS CLI command

When executing the following command in the mac terminal I got an error: aws configure
I couldn't really find anything helpful online and I am newbie to mac and to aws. Can somebody please help me fix it?
same thing would happen with other commands like aws --version
commands like which awswould work normally
Traceback (most recent call last):
File "botocore/configloader.py", line 149, in raw_config_parse
File "configparser.py", line 696, in read
File "configparser.py", line 1091, in _read
configparser.DuplicateOptionError: While reading from '/Users/sj-auteon/.aws/credentials' [line 4]: option 'aws_access_key_id' in section 'default' already exists
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "aws", line 27, in <module>
File "aws", line 23, in main
File "awscli/clidriver.py", line 90, in main
File "awscli/clidriver.py", line 99, in create_clidriver
File "botocore/session.py", line 361, in full_config
File "botocore/configloader.py", line 152, in raw_config_parse
botocore.exceptions.ConfigParseError: Unable to parse config file: /Users/sj-auteon/.aws/credentials
[831] Failed to execute script aws```
Based on the comments. The solution was to delete existing .aws/credentials and create new one using aws configure command.

ImportError: cannot import name _remove_dead_weakref python 2.7

I use windows 7 and python 2.7
When I used py2exe to make an .exe file I get the error;
Traceback (most recent call last):
File "mainpy", line 17, in
File "main.py", line 17, in
File "zipextimporter.pyc", line 82, in load_module
File "zipextimporter.pyc", line 82, in load_module
File "logging_init_.pyc", line 26, in
File "zipextimporter.pyc", line 82, in load_module
File "weakref.pyc", line 14, in
ImportError: cannot import name _remove_dead_weakref
The same code could be used to make an .exe file in another computer so there is nothing wrong with the code in main.py. The minor environmental difference may cause this problem. I used pycharm, python 2.7.10 and py2exe 0.6.9. On another computer all other config are the same except using sublimetext instead of pycharm.
Could anyone please tell me how to fix that?
Another tricky thing is that
It is possible that the library does not exists for the other computer.Please check whether the library exists or not.

Matlab r2017a error with python "Undefined function or variable 'imfilter_mex'"

I got the following error on matlab r2017a runtime;
Undefined function or variable 'imfilter_mex'.
Error in imfilter>filterPartOrWhole (line 362)
Error in imfilter (line 178)
Error in imagePrepy (line 31)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/MATLAB/MATLAB_Runtime/v92/toolbox/compiler_sdk/pysdk_py/matlab_pysdk/runtime/deployablefunc.py", line 81, in __call__
nlhsWasSpecified, stdoutObj, stderrObj).result()
File "/usr/local/MATLAB/MATLAB_Runtime/v92/toolbox/compiler_sdk/pysdk_py/matlab_pysdk/runtime/futureresult.py", line 135, in result
raise e
matlab_pysdk.runtime.MatlabRuntimeError: An error occurred when evaluating the result from a function. Details:
File /home/ubuntu/.mcrCache9.2/imageP1/toolbox/images/images/imfilter.m, line 362, in filterPartOrWhole
File /home/ubuntu/.mcrCache9.2/imageP1/toolbox/images/images/imfilter.m, line 178, in imfilter
File /home/ubuntu/.mcrCache9.2/imageP1/imageP/imagePrepy.m, line 31, in imagePrepy
Undefined function 'imfilter_mex' for input arguments of type 'uint8'.
I think you tried to run your compiled code on another system. For example, you compile your code with a Windows x64 system and you try run it on a Linux system - this won't work.
Your are using imfilter and this MATLAB internal function uses a MEX function, so it matters from which operating system you have compiled your code.
I had the some error and maybe it helps someone else!

Can't install pip because I get "the system cannot find the file specified" whenever I run get-pip.py (python 2.7)

So I'm running Python 2.7.11 and am trying to install pip. I thought pip was already installed on Python 2 >= 2.7.9, but I guess I was wrong. Whenever I try to run get-pip.py, I get:
`Traceback (most recent call last):
File "get-pip.py", line 19177, in <module>
main()
File "get-pip.py", line 194, in main
bootstrap(tmpdir=tmpdir)
File "get-pip.py", line 82, in bootstrap
import pip
File "c:\users\user\appdata\local\temp\tmp41xybl\pip.zip\pip\__init__.py", line 14, in <module>
File "c:\users\user\appdata\local\temp\tmp41xybl\pip.zip\pip\utils\__init__.py", line 23, in <module>
File "c:\users\user\appdata\local\temp\tmp41xybl\pip.zip\pip\locations.py", line 120, in <module>
File "c:\users\user\appdata\local\temp\tmp41xybl\pip.zip\pip\utils\appdirs.py", line 150, in site_config_dirs
File "c:\users\user\appdata\local\temp\tmp41xybl\pip.zip\pip\utils\appdirs.py", line 191, in _get_win_folder_from_registry
WindowsError: [Error 2] The system cannot find the file specified`
I really don't know what I'm doing wrong, and there aren't any helpful answers online. Can someone help me understand what I need to do to fix this and get pip installed? Thanks.

Bottle micro framework suddenly crash

i have web app that i have developed using bottle micro framework.
However it crash a lot and all of them suddenly without any action ( without using the web app) . So i have reviewed the logs file and find the following errors (i have no idea what the causation of these errors):
Traceback (most recent call last):
File "/home/hamoud/lib/python2.7/bottle.py", line 2699, in run
server.run(app)
File "/home/hamoud/lib/python2.7/bottle.py", line 2385, in run
srv = make_server(self.host, self.port, handler, **self.options)
File "/usr/local/lib/python2.7/wsgiref/simple_server.py", line 144, in make_server
server = server_class((host, port), handler_class)
File "/usr/local/lib/python2.7/SocketServer.py", line 419, in __init__
self.server_bind()
File "/usr/local/lib/python2.7/wsgiref/simple_server.py", line 48, in server_bind
HTTPServer.server_bind(self)
File "/usr/local/lib/python2.7/BaseHTTPServer.py", line 108, in server_bind
SocketServer.TCPServer.server_bind(self)
File "/usr/local/lib/python2.7/SocketServer.py", line 430, in server_bind
self.socket.bind(self.server_address)
File "/usr/local/lib/python2.7/socket.py", line 224, in meth
return getattr(self._sock,name)(*args)
TypeError: 'int' object is not callable
and
Traceback (most recent call last):
File "interface.py", line 29, in <module>
run(host="localhost", port=32471, reloader=True, debug=True)
File "/home/hamoud/lib/python2.7/bottle.py", line 2657, in run
os.utime(lockfile, None) # I am alive!
OSError: [Errno 2] No such file or directory: '/tmp/bottle.gQmJc8.lock'
However the second error doesn't crash the application ( application would continue working ) but for the first one it's require manual work ( run the app again ).
i could schedule task using cron job to run the application when it's crash. but i'd like to know what's the problem in my app.
A few ideas come to mind:
Could there be another program on your machine (e.g., a cron job) that is deleting files from /tmp?
Are you using the latest version of Bottle? (From the line number in your stacktrace, it looks like you might not be.)
If nothing else works, try running without reloader=True (or use reloader=False). I looked at the Bottle code, and that change should at least work around the problem, even though we don't know the cause (yet).
Hope that helps.