I’m installing nu-validator on windows 64-bit platform.
As soon as i ran this command it gave me this output.
D:IOPvalidator>python ./build/build.py all
Traceback (most recent call last):
File "./build/build.py", line 73, in <module>
validatorVersion = time.strftime('%y.%-m.%-e')
ValueError: Invalid format string
so i made following changes and it gor executed after that.
validatorVersion = time.strftime('%y.%-m.%-e') to validatorVersion = time.strftime('%d %B %Y')
after some time i got this error
D:IOPvalidator>python ./build/build.py all
git submodule update --init
Submodule 'galimatias' (https://github.com/validator/galimatias.git) registered
for path 'galimatias'
Submodule 'htmlparser' (https://github.com/validator/htmlparser.git) registered
for path 'htmlparser'
Submodule 'jing-trang' (https://github.com/relaxng/jing-trang.git) registered fo
r path 'jing-trang'
Submodule 'tests' (https://github.com/validator/tests.git) registered for path '
tests'
Cloning into 'galimatias'...
remote: Counting objects: 2687, done.
remote: Total 2687 (delta 0), reused 0 (delta 0), pack-reused 2687
Receiving objects: 100% (2687/2687), 1016.76 KiB | 147.00 KiB/s, done.
Resolving deltas: 100% (1388/1388), done.
Checking connectivity... done.
Submodule path 'galimatias': checked out 'd111d6e6e70872f893b2f903c61577b28bb7d4
57'
Cloning into 'htmlparser'...
remote: Counting objects: 9174, done.
remote: Total 9174 (delta 0), reused 0 (delta 0), pack-reused 9174R
Receiving objects: 100% (9174/9174), 4.10 MiB | 373.00 KiB/s, done.
Resolving deltas: 0% (0/4290)
Resolving deltas: 100% (4290/4290), done.
Checking connectivity... done.
Submodule path 'htmlparser': checked out '0706524421fc046e113b4efadaba5c70584e07
06'
Cloning into 'jing-trang'...
remote: Counting objects: 24078, done.
remote: Total 24078 (delta 0), reused 0 (delta 0), pack-reused 24078
Receiving objects: 100% (24078/24078), 27.88 MiB | 414.00 KiB/s, done.
Resolving deltas: 100% (13166/13166), done.
Checking connectivity... done.
Submodule path 'jing-trang': checked out '35eb11b84a230ee4d7168f12f98a28bf40e940
aa'
Cloning into 'tests'...
remote: Counting objects: 6113, done.
rReceiving objects: 100% (6113/611emote: Total 6113 (delta 0), reused 0 (delta 0
), pack-reused 6113
Receiving objects: 100% (6113/6113), 1.02 MiB | 196.00 KiB/s, done.
Resolving deltas: 100% (3116/3116), done.
Checking connectivity... done.
Submodule path 'tests': checked out '942284e43bcb655db86ceba2e80a7dff36d457ca'
https://repo1.maven.org/maven2/com/ibm/icu/icu4j/54.1.1/icu4j-54.1.1.jar
https://repo1.maven.org/maven2/com/shapesecurity/salvation/1.0.3/salvation-1.0.3
.jar
https://repo1.maven.org/maven2/commons-codec/commons-codec/1.10/commons-codec-1.
10.jar
https://repo1.maven.org/maven2/commons-fileupload/commons-fileupload/1.3.1/commo
ns-fileupload-1.3.1.jar
https://repo1.maven.org/maven2/commons-io/commons-io/2.4/commons-io-2.4.jar
https://repo1.maven.org/maven2/commons-logging/commons-logging/1.2/commons-loggi
ng-1.2.jar
https://repo1.maven.org/maven2/commons-logging/commons-logging/1.2/commons-loggi
ng-1.2-adapters.jar
https://repo1.maven.org/maven2/commons-logging/commons-logging/1.2/commons-loggi
ng-1.2-api.jar
https://repo1.maven.org/maven2/javax/servlet/javax.servlet-api/3.1.0/javax.servl
et-api-3.1.0.jar
https://repo1.maven.org/maven2/junit/junit/4.12/junit-4.12.jar
https://repo1.maven.org/maven2/log4j/log4j/1.2.17/log4j-1.2.17.jar
https://repo1.maven.org/maven2/net/sourceforge/jchardet/jchardet/1.0/jchardet-1.
0.jar
https://repo1.maven.org/maven2/org/apache/httpcomponents/httpclient/4.4/httpclie
nt-4.4.jar
https://repo1.maven.org/maven2/org/apache/httpcomponents/httpcore/4.4/httpcore-4
.4.jar
https://repo1.maven.org/maven2/org/easytesting/fest-assert/1.4/fest-assert-1.4.j
ar
https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-http/9.2.9.v20150224/jett
y-http-9.2.9.v20150224.jar
https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-io/9.2.9.v20150224/jetty-
io-9.2.9.v20150224.jar
https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-security/9.2.9.v20150224/
jetty-security-9.2.9.v20150224.jar
https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-server/9.2.9.v20150224/je
tty-server-9.2.9.v20150224.jar
https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-servlet/9.2.9.v20150224/j
etty-servlet-9.2.9.v20150224.jar
https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-servlets/9.2.9.v20150224/
jetty-servlets-9.2.9.v20150224.jar
https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-util/9.2.9.v20150224/jett
y-util-9.2.9.v20150224.jar
https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-util-ajax/9.2.9.v20150224
/jetty-util-ajax-9.2.9.v20150224.jar
https://repo1.maven.org/maven2/org/hamcrest/hamcrest-api/1.0/hamcrest-api-1.0.ja
r
https://repo1.maven.org/maven2/org/mozilla/rhino/1.7R5/rhino-1.7R5.jar
https://repo1.maven.org/maven2/org/slf4j/slf4j-api/1.7.13/slf4j-api-1.7.13.jar
https://repo1.maven.org/maven2/xom/xom/1.2.5/xom-1.2.5.jar
https://raw.githubusercontent.com/tabatkins/parse-css/a878df1503af3bfb63493a6368
5a117a24988959/parse-css.js
https://raw.githubusercontent.com/douglascrockford/JSON-js/3d7767b6b1f3da363c625
ff54e63bbf20e9e83ac/json.js
https://help.whatwg.org/extensions/a-rel/
https://help.whatwg.org/extensions/link-rel/
https://wiki.whatwg.org/wiki/MicrosyntaxDescriptions
https://www.iana.org/assignments/language-subtag-registry/language-subtag-regist
ry
https://wiki.whatwg.org/wiki/Validator.nu_alt_advice
.ant
Traceback (most recent call last):
File "./build/build.py", line 1503, in <module>
File "./build/build.py", line 1231, in buildAll
File "./build/build.py", line 648, in buildJing
File "./build/build.py", line 217, in runCmd
File "C:Python27libsubprocess.py", line 522, in call
return Popen(*popenargs, **kwargs).wait()
File "C:Python27libsubprocess.py", line 710, in __init__
errread, errwrite)
File "C:Python27libsubprocess.py", line 958, in _execute_child
startupinfo)
WindowsError: [Error 193] %1 is not a valid Win32 application
So i changed my python27 version and installed python34-64bit.
which gave me following error
`C:UsersNU00351442Documentsinteroperabilityvnu.jar_16.1.1validator>python .
/build/build.py all
git submodule update --init
Submodule 'galimatias' (https://github.com/validator/galimatias.git) registered
for path 'galimatias'
Submodule 'htmlparser' (https://github.com/validator/htmlparser.git) registered
for path 'htmlparser'
Submodule 'jing-trang' (https://github.com/relaxng/jing-trang.git) registered fo
r path 'jing-trang'
Submodule 'tests' (https://github.com/validator/tests.git) registered for path '
tests'
Cloning into 'galimatias'...
remote: Counting objects: 2687, done.
remote: Total 2687 (delta 0), reused 0 (delta 0), pack-reused 2687Receiving obje
cts: 98% (2634/2687), 932.01 KiB | 169.00 KiB/s
Receiving objects: 100% (2687/2687), 1016.76 KiB | 170.00 KiB/s, done.
Resolving deltas: 100% (1388/1388), done.
Checking connectivity... done.
Submodule path 'galimatias': checked out 'd111d6e6e70872f893b2f903c61577b28bb7d4
57'
Cloning into 'htmlparser'...
remote: Counting objects: 9174, done.
remote: Total 9174 (delta 0), reused 0 (delta 0), pack-reused 9174
Receiving objects: 100% (9174/9174), 4.10 MiB | 480.00 KiB/s, done.
Resolving deltas: 100% (4290/4290), done.
Checking connectivity... done.
Submodule path 'htmlparser': checked out '0706524421fc046e113b4efadaba5c70584e07
06'
Cloning into 'jing-trang'...
remote: Counting objects: 24078, done.
remote: Total 24078 (delta 0), reused 0 (delta 0), pack-reused 24078
Receiving objects: 100% (24078/24078), 27.88 MiB | 170.00 KiB/s, done.
Resolving deltas: 100% (13166/13166), done.
Checking connectivity... done.
Submodule path 'jing-trang': checked out '35eb11b84a230ee4d7168f12f98a28bf40e940
aa'
Cloning into 'tests'...
remote: Counting objects: 6113, done.
remote: Total 6113 (delta 0), reused 0 (delta 0), pack-reused 6113
Receiving objects: 100% (6113/6113), 1.02 MiB | 141.00 KiB/s, done.
Resolving deltas: 100% (3116/3116), done.
Checking connectivity... done.
Submodule path 'tests': checked out '942284e43bcb655db86ceba2e80a7dff36d457ca'
https://repo1.maven.org/maven2/com/ibm/icu/icu4j/54.1.1/icu4j-54.1.1.jar
https://repo1.maven.org/maven2/com/shapesecurity/salvation/1.0.3/salvation-1.0.3
.jar
Traceback (most recent call last):
File "C:Python34liburllibrequest.py", line 1183, in do_open
h.request(req.get_method(), req.selector, req.data, headers)
File "C:Python34libhttpclient.py", line 1137, in request
self._send_request(method, url, body, headers)
File "C:Python34libhttpclient.py", line 1182, in _send_request
self.endheaders(body)
File "C:Python34libhttpclient.py", line 1133, in endheaders
self._send_output(message_body)
File "C:Python34libhttpclient.py", line 963, in _send_output
self.send(msg)
File "C:Python34libhttpclient.py", line 898, in send
self.connect()
File "C:Python34libhttpclient.py", line 1279, in connect
super().connect()
File "C:Python34libhttpclient.py", line 871, in connect
self.timeout, self.source_address)
File "C:Python34libsocket.py", line 498, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
File "C:Python34libsocket.py", line 537, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 11004] getaddrinfo failed
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "./build/build.py", line 1500, in <module>
downloadDependencies()
File "./build/build.py", line 1224, in downloadDependencies
downloadDependency(url, md5sum)
File "./build/build.py", line 1215, in downloadDependency
fetchUrlTo(url, path, md5sum)
File "./build/build.py", line 1084, in fetchUrlTo
f = urlopen(url)
File "C:Python34liburllibrequest.py", line 161, in urlopen
return opener.open(url, data, timeout)
File "C:Python34liburllibrequest.py", line 464, in open
response = self._open(req, data)
File "C:Python34liburllibrequest.py", line 482, in _open
'_open', req)
File "C:Python34liburllibrequest.py", line 442, in _call_chain
result = func(*args)
File "C:Python34liburllibrequest.py", line 1226, in https_open
context=self._context, check_hostname=self._check_hostname)
File "C:Python34liburllibrequest.py", line 1185, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [Errno 11004] getaddrinfo failed>
`
Can you help me from here ?
- What Is the
OSError: [WinError 193] %1 is not a valid Win32 application
- Why Does the
OSError: [WinError 193] %1 is not a valid Win32 application
Occurs - Different Reasons and Solutions of
OSError: [WinError 193] %1 is not a valid Win32 application
You receive an error when attempting to run an executable (.exe
) file. This error occurs when an executable file is not a valid Win32 application.
It may be caused by a mismatch between the local computer’s processor architecture and the executable file’s architecture. When you double-click the .exe
file, you may receive the error message:
Error: oserror: [winerror 193] %1 is not a valid win32 application.
Error loading %
What Is the OSError: [WinError 193] %1 is not a valid Win32 application
One of the biggest frustrations when developing with Python is dealing with Python errors. There are a lot of different errors that can occur when writing Python code, but one of the most confusing errors to deal with is the OSError: [WinError 193] %1 is not a valid Win32 application
.
This error occurs when you try to run a Python script or program that has not been installed correctly on your computer.
You will get the error whether you run a Python script from the command line or double-clicking a file associated with Python. This error is also different from a syntax error or other error that tells you that there is an error in your Python code.
This error is usually caused by an incorrect path to your computer’s Python executable or .pyd
file.
Why Does the OSError: [WinError 193] %1 is not a valid Win32 application
Occurs
Whenever you open a new window in your browser, an error message could pop up saying that the application you are trying to open is not a valid Win32 application. This error occurs in the Internet Explorer browser, meaning that the file you are trying to open is not a valid application.
This can be a crucial security hole, as any file can be marked as a valid Win32 application by simply modifying its file extension. It’s very easy to do this with common file editing software.
So, if you are not careful, you will open a file you have no business with. One of the most common reasons this error happens is because you are trying to open a file that is not an application.
For example, if you have some HTML file with a .html
extension, it will not work. You need to change the file extension to .exe
to open the file in your browser.
Another reason might be that the file is corrupt or has some other issues. In this case, you need to download the file again from the source and try opening it on your computer.
Different Reasons and Solutions of OSError: [WinError 193] %1 is not a valid Win32 application
Below are the reasons and solutions for the error.
Python subprocess
Module on a Python File
You’re calling the Python subprocess
module on a Python file. The Python subprocess
module only accepts command line arguments.
To run Python code, you will need to create a Win32 executable that can be run via the subprocess
module or use the subprocess
module in Python code by running it as a script.
There is an example of an OSError
. This code will show the OSError
, and then we will provide the solution for this error.
import subprocess
subprocess.call(['hello.py', 'htmlfilename.htm'])
Output:
OSError: [WinError 193] %1 is not a valid Win32 application
In this scenario, when we call a Python file hello.py
within the Python interpreter with subprocess
, it will show an OSError
.
This will show that hello.py
is not executable. For execution, the executable must be clear like:
subprocess.call(['python.exe', 'hello.py', 'htmlfilename.htm'])
If you want to make python.exe
visible in the search path, then you should pass the entire path from the executable that will run the python.exe
address.
import sys
import subprocess
subprocess.call([sys.executable, 'hello.py', 'htmlfilename.htm'])
Incompatible Versions of Python and TensorFlow
Incompatible versions of Python and TensorFlow are a reason for OSError
. Due to incompatible versions of Python and TensorFlow, this application has stopped functioning.
This can occur if a different version of Python is installed on your computer than the version of Python that TensorFlow was built with. You can fix this by reinstalling TensorFlow and updating your PATH
variable to point to the correct Python installation.
Sometimes you may have problems with running Python scripts with TensorFlow on Windows. If you see the OSError: [WinError 193] %1 is not a valid Win32 application
; this happens because TensorFlow is a 64-bit application, while Python is 32-bit, and you are trying to run a 32-bit version of Python with a 64-bit TensorFlow.
To fix this, you need to install the 32-bit version of TensorFlow.
Python Environments Dispute
Updating your Python environments is a bit of a hassle because two different versions of Python environments are available: 32-bit and 64-bit. And many people fail to update their Python environments.
This failure can cause your Python environments to malfunction and crash your computer. If you use Python environments on your computer, you need to update it as soon as possible.
If you don’t use Python environments, you should check out an article on the benefits of Python environments.
A clean Python environment is the best way to run the Python scripts. If you are getting a Windows error OSError: [WinError 193] %1 is not a valid Win32 application
while running a Python script, the problem is most likely with your Python installation.
So you need to ensure that you have a clean Python environment.
When you install Python, it adds a shortcut to its folder on your desktop and your Start menu. You also install pip
, which lets you install third-party Python modules.
However, Python keeps a record of all the modules you have installed. This can make it difficult to update your Python installation because you have to remove those modules before you can update Python.
So, what you need to do is to delete the folder that contains the Python installation files. For many people, this folder is C:Python27
.
Calling a 32-Bit DLL File Into a 64-Bit Process
You are calling a 32-bit DLL file into a 64-bit process. This error usually occurs when you have a 32-bit and 64-bit version of a DLL.
For example, a feature you are trying to use is found in a 32-bit DLL and a 64-bit DLL. The 64-bit DLL overrides the functions of the 32-bit DLL.
You can see this error when running a 64-bit process using a 32-bit DLL.
One of the most common errors when running a 32-bit application on a 64-bit operating system is the error message: OSError: [WinError 193] %1 is not a valid Win32 application
. The error message has a %1
in place of the application you are trying to run.
The error pops up when you try to run the application, which is not a valid Win32 application. If the application is a 32-bit application, you need to install the 32-bit version of the application.
If the application is a 64-bit application, you need to install the 64-bit version of the application.
Running Semgrep
Directly
It can be quite annoying when you try to launch Semgrep
directly on Windows. It can cause an OSError
.
So you should avoid running semgrep
directly on Windows.
You go to your Start menu, and there is no Semgrep.exe
application to be seen. It’s not there because Semgrep
is not a typical Windows application but a console application.
If you want to use Semgrep
directly on Windows, you will have to launch it through a cmd
window. The easiest way is to hold down your Windows key and press the R key.
This will open the run prompt. At this point, you should type cmd
and press Enter.
You now have a command prompt. You can now go to the directory where Semgrep
is installed and type in semgrep
.
Due to Old Data
Old data from the last installation of PyCharm may cause the OSError
. So to avoid this error, you should follow this solution.
You have old data from a previous installation of PyCharm in the following directory: C:Users<your_name>.ipython profile_defaulthistory
.
This directory contains files that a previous version of PyCharm has created and can contain old files (for example, a file with a name generated by a previous version of PyCharm).
To prevent this directory from being created in the future, select the option Do not create a .ipython directory
in the profile settings. Note that this will not affect the history of files that already exist in the directory.
Thread Rating:
- 0 Vote(s) — 0 Average
- 1
- 2
- 3
- 4
- 5
[WinError 193] %1 is not a valid Win32 application |
Hello people, I am pretty new at working with python and I am encoutering the error as stated in the subject. Full error:
I have already googled it and many answers say it is a bit 32bit vs 64bit issue. However I don’t know what the problem would be :huh: I use a 32bit eclipse with PyDev plugin Is there anything else that should be 32bits? Any help is appreciated Posts: 1,298 Threads: 38 Joined: Sep 2016 Reputation: What code are you trying to run? Note that Win32 does not indicate you are running 32 bit code, it is just a label indicating you are using a Windows platform
If it ain’t broke, I just haven’t gotten to it yet. Posts: 5,147 Threads: 395 Joined: Sep 2016 Reputation: try running the program from a command line/terminal. Zest
Posts: 7 Threads: 1 Joined: Oct 2016 Reputation: what exactly do you mean with 32bit code? how can i check how many bits my code is? for a project i have been provided with a toolbox written in python and i’m trying to import a module from this toolbox (could this toolbox perhaps be 64bits? and if so how can i check?). i have placed all files in the same folder. Posts: 1,298 Threads: 38 Joined: Sep 2016 Reputation: Oct-17-2016, 09:53 PM
When we ask for your code, it means the Python code you have written. import module_name # This is the name of the module you are trying to import # Here is you code that you've written to use that module At this point, do not worry about 32 and 64 bit stuff. Where did you get the ‘toolbox’ from?
If it ain’t broke, I just haven’t gotten to it yet. Zest
Posts: 7 Threads: 1 Joined: Oct 2016 Reputation: alright well the main class looks like this, nothing special, the toolbox was written and provided by someone I know and it isn’t public so I should probably not be sharing that without permission :-/ import lib_pct_build_network if __name__ == '__main__': pass is there anything you would like to know/see about the toolbox/library? Posts: 6,572 Threads: 116 Joined: Sep 2016 Reputation:
When say python 3.5 (32 bits) is this trough anaconda?
The error message is because you mixing are 32-bit and 64-bit. Zest
Posts: 7 Threads: 1 Joined: Oct 2016 Reputation: Oct-17-2016, 10:10 PM i ran it in the terminal and a similar error happens: https://gyazo.com/d62c64801b849bbe9b5205f1e8dc2620 @snippsat, if it says so in the stack (the quote) then it must go through anaconda i think? i checked the python in anaconda and it is 32bits https://gyazo.com/930044477b5180cd65da09922eb4ebbc Posts: 5,147 Threads: 395 Joined: Sep 2016 Reputation: Oct-17-2016, 10:27 PM
Usually .so is a lib built under linux with the equivalent in windows a .dll. Zest
Posts: 7 Threads: 1 Joined: Oct 2016 Reputation: Oct-17-2016, 10:31 PM
@metulburr, thanks
i don’t know, seems probable |