This fails in IronPython Interactive inside Visual Studio 2010:
» import random
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named random
The same works fine in IronPython code in Visual Studio. It also works fine if I launch ipy.exe inside a Windows command prompt. What is the problem with IronPython Interactive and import? How do I fix Python Interactive so that it can import Python modules?
sys.path in IronPython Interactive gives this:
» import sys
» sys.path
['.',
'C:\\PROGRAM FILES (X86)\\MICROSOFT VISUAL STUDIO 10.0\\COMMON7\\IDE\\EXTENSIONS\\MICROSOFT\\IRONSTUDIO\\0.4\\Lib',
'C:\\PROGRAM FILES (X86)\\MICROSOFT VISUAL STUDIO 10.0\\COMMON7\\IDE\\EXTENSIONS\\MICROSOFT\\IRONSTUDIO\\0.4\\DLLs']
sys.path in ipy.exe on Windows command prompt gives this:
>>> import sys
>>> sys.path
['.',
'C:\\Users\\MyName\\Desktop',
'C:\\Program Files (x86)\\IronPython 2.7\\Lib',
'C:\\Program Files (x86)\\IronPython 2.7\\DLLs',
'C:\\Program Files (x86)\\IronPython 2.7',
'C:\\Program Files (x86)\\IronPython 2.7\\lib\\site-packages']
I am using IronPython 2.7, Visual Studio 2010 and Windows 7 64-bit.
As you can see sys.path directories are different;
I suspect random module is implemented in IronPython.Modules.dll, then you should check if such dll is present in the paths of IronPython interactive.
If it's present, the problem is another and I don't know what could be...
otherwise in Ironpython interactive, before import random do:
sys.path.append(path)
with path being the folder of IronPython.Modules.dll (I guess 'C:\Program Files (x86)\IronPython 2.7') and it should work.
Related
I have almost finished building chromium from my windows desktop but I am stuck at the last step, running gn gen out/Default. I have checked my visual studio installer and Windows 10 SDK version 10.0.19041.0 has been already installed. I do not know what to do. The whole output is like the following:
C:\chromium\src>gn gen out/Default
Traceback (most recent call last):
File "C:/chromium/src/build/vs_toolchain.py", line 573, in <module>
sys.exit(main())
File "C:/chromium/src/build/vs_toolchain.py", line 569, in main
return commands[sys.argv[1]](*sys.argv[2:])
File "C:/chromium/src/build/vs_toolchain.py", line 400, in CopyDlls
_CopyDebugger(target_dir, target_cpu)
File "C:/chromium/src/build/vs_toolchain.py", line 433, in _CopyDebugger
raise Exception('%s not found in "%s"\r\nYou must install'
Exception: dbghelp.dll not found in "C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\dbghelp.dll"
You must installWindows 10 SDK version 10.0.19041.0 including the "Debugging Tools for Windows" feature.
ERROR at //build/toolchain/win/BUILD.gn:54:3: Script returned non-zero exit code.
exec_script("../../vs_toolchain.py",
^----------
Current dir: C:/chromium/src/out/Default/
Command: C:/src/depot_tools/bootstrap-3_8_0_chromium_8_bin/python3/bin/python3.exe C:/chromium/src/build/vs_toolchain.py copy_dlls C:/chromium/src/out/Default Debug x64
Returned 1.
See //BUILD.gn:66:1: which caused the file to be included.
group("gn_all") {
From the chromium docs:
The SDK Debugging Tools must also be installed. If the Windows 10 SDK
was installed via the Visual Studio installer, then they can be
installed by going to: Control Panel → Programs → Programs and
Features → Select the “Windows Software Development Kit” → Change →
Change → Check “Debugging Tools For Windows” → Change. Or, you can
download the standalone SDK installer and use it to install the
Debugging Tools.
I'm trying to install Chromium on my Windows machine. I'm closely following the instructions linked to from the Chromium project site. I tried running the command gn gen out/Default, but got the following error message (with some paths anonymized):
Traceback (most recent call last):
File "C:/path/to/chromium/src/build/toolchain/win/setup_toolchain.py", line 292, in <module>
main()
File "C:/path/to/chromium/src/build/toolchain/win/setup_toolchain.py", line 284, in main
assert vc_lib_um_path
AssertionError
ERROR at //build/toolchain/win/BUILD.gn:408:30: Script returned non-zero exit code.
win_64bit_toolchain_data = exec_script("setup_toolchain.py",
^----------
Current dir: C:/path/to/chromium/src/out/Default/
Command: C:/path/to/depot_tools/win_tools-2_7_6_bin/python/bin/python.exe C:/path/to/chromium/src/build/toolchain/win/setup_toolchain.py "C:\Program Files (x86)/Microsoft Visual Studio/2017/Enterprise" "C:\Program Files (x86)\Windows Kits\10" "C:\WINDOWS\Sysnative;C:\WINDOWS/SysWOW64" win x64 environment.x64
Returned 1 and printed out:
vc_bin_dir = "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.15.26726\\bin\\HostX64\\x64"
include_flags_I = "\"/I..\\..\\..\\..\\..\\..\\..\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.15.26726\\ATLMFC\\include\" \"/I..\\..\\..\\..\\..\\..\\..\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.15.26726\\include\" \"/I..\\..\\..\\..\\..\\..\\..\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17763.0\\ucrt\" \"/I..\\..\\..\\..\\..\\..\\..\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17134.0\\shared\" \"/I..\\..\\..\\..\\..\\..\\..\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17134.0\\um\" \"/I..\\..\\..\\..\\..\\..\\..\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17134.0\\winrt\" \"/I..\\..\\..\\..\\..\\..\\..\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17134.0\\cppwinrt\""
include_flags_imsvc = "\"-imsvc..\\..\\..\\..\\..\\..\\..\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.15.26726\\ATLMFC\\include\" \"-imsvc..\\..\\..\\..\\..\\..\\..\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.15.26726\\include\" \"-imsvc..\\..\\..\\..\\..\\..\\..\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17763.0\\ucrt\" \"-imsvc..\\..\\..\\..\\..\\..\\..\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17134.0\\shared\" \"-imsvc..\\..\\..\\..\\..\\..\\..\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17134.0\\um\" \"-imsvc..\\..\\..\\..\\..\\..\\..\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17134.0\\winrt\" \"-imsvc..\\..\\..\\..\\..\\..\\..\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17134.0\\cppwinrt\""
vc_lib_path = "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.15.26726\\lib\\x64"
vc_lib_atlmfc_path = "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.15.26726\\ATLMFC\\lib\\x64"
See //build/toolchain/win/BUILD.gn:458:1: whence it was called.
win_64bit_toolchains("x64") {
^----------------------------
See //BUILD.gn:61:1: which caused the file to be included.
group("gn_all") {
^----------------
Traceback (most recent call last):
File "C:/path/to/chromium/src/build/toolchain/win/setup_toolchain.py", line 292, in <module>
main()
File "C:/path/to/chromium/src/build/toolchain/win/setup_toolchain.py", line 284, in main
assert vc_lib_um_path
AssertionError
Looking at the source for setup_toolchain.py (where the error was), I think the problem is on these lines:
for path in env['LIB'].split(';'):
if os.path.exists(os.path.join(path, 'User32.Lib')):
vc_lib_um_path = os.path.realpath(path)
break
After adding some print statements, it appears that the loop is checking if the following paths exist:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.15.26726\ATLMFC\lib\x64\User32.Lib
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.15.26726\lib\x64\User32.Lib
C:\Program Files (x86)\Windows Kits\10\lib\10.0.17763.0\ucrt\x64\User32.Lib
C:\Program Files (x86)\Windows Kits\10\lib\10.0.17134.0\um\x64\User32.Lib
User32.Lib
None of these paths do exist. I don't really have a good enough understanding of Windows, Visual Studio, or C to know what User32.Lib means. Is it something that Visual Studio should have added somewhere? Or when I installed the Windows 10 SDK, should a file have been generated somewhere? Is there something I can do to solve this problem?
I'm struggling to figure out what could go wrong and cause this problem, and any help would be greatly appreciated.
Looks like GN does not find the required runtime requirements. The scripts are somewhat fragile on this.
In my case, I installed visual 2017 and 2019, this issue happens. So, I uninstall visual 2019 and it works well.
Reverify the runtime specs (SDK, VS version, paths etc).
https://bitbucket.org/chromiumembedded/cef/wiki/MasterBuildQuickStart.md#markdown-header-windows-setup
I have installed python 3 and wxpython. Programs with
import wx
work when executed from the command line:
python helloworld.py
When I run the program with Visual Studio 2017, I get a build error:
ModuleNotFoundError: No module named 'wx'
My python environment is set to python 3. I don't understand how to include the wx module.
wxpython needs to be installed to Visual Studio:
In your project, under "Python Environments", right click on your python installation e.g. Python 3.6. In the dropdown menu, click on "install python package...".
Then select "install wxpython" from the list. Results are displayed in the output window. Wait for the install to complete i.e. wait for the green progress bar indicator to finish.
My question is, how can I make the VS Code command line work properly when manually adding it to PATH on Windows?
Inside of Visual Studio Code, I first tried to install it with the tickbox "install to PATH", but when I typed code in the command prompt, it said command not recognized. So I manually edited PATH and added C:\Program Files (x86)\Microsoft VS Code.
However, when running commands such as:
code -v
the command prompt doesn't print anything, but launches Visual Studio Code instead.
Your path environment variable should include C:\Program Files (x86)\Microsoft VS Code\bin instead of C:\Program Files (x86)\Microsoft VS Code (notice the added \bin at the end).
The bin sub directory provides the batch file code.cmd, that processes the command line before launching code.exe from the parent directory. Going through the batch file is required for the command line to work properly.
I've build WebKit-r128959 successfully on Win7/VS2010, but now the source (WebKit-r161259) has changed a lot and my experience doesn't work any longer...
I met this first error.
WebKitSupportLibrary is up-to-date.
Building results into: /cygdrive/c/cygwin_dir/home/LioMoon/WebKit-r161249/WebKitBuild
WEBKIT_OUTPUTDIR is set to: C:\cygwin_dir\home\LioMoon\WebKit-r161249\WebKitBuild
WEBKIT_LIBRARIES is set to: C:\cygwin_dir\home\LioMoon\WebKit-r161249\WebKitLibraries\win
/cygdrive/c/Program Files/Microsoft Visual Studio 10.0/Common7/IDE/devenv.com WebKit.vcxproj\WebKit.sln /build Release|Win32
Microsoft (R) Visual Studio Version 10.0.40219.1.
Copyright (C) Microsoft Corp. All rights reserved.
------ Build started: Project: WTFGenerated, Configuration: Release Win32 ------
Build started 1/4/2014 7:05:45 AM.
Build:
/usr/bin/which: no bash in ((null))
'nmake' is not recognized as an internal or external command,
operable program or batch file.
C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.MakeFile.Targets(38,5): error MSB3073: The command "%SystemDrive%\cygwin\bin\which.exe bash
C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.MakeFile.Targets(38,5): error MSB3073: if errorlevel 1 set PATH=%SystemDrive%\cygwin\bin;%PATH%
C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.MakeFile.Targets(38,5): error MSB3073: set PLATFORMARCHITECTURE=32
C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.MakeFile.Targets(38,5): error MSB3073: nmake /nologo -f WTFGenerated.make" exited with code 9009.
Build FAILED.
I just don't understand why the path is (null) and why the devenv executable cannot find nmake. The following lines are the path variable in VS2010:
Path=C:\Program Files\Microsoft F#\v4.0\;C:\Program Files\Microsoft Visual Studi
o 10.0\VSTSDB\Deploy;C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\;
c:\Program Files\Microsoft Visual Studio 10.0\VC\BIN;C:\Program Files\Microsoft
Visual Studio 10.0\Common7\Tools;c:\Windows\Microsoft.NET\Framework\v4.0.30319;c
:\Windows\Microsoft.NET\Framework\v3.5;c:\Program Files\Microsoft Visual Studio
10.0\VC\VCPackages;C:\Program Files\HTML Help Workshop;C:\Program Files\Microsof
t Visual Studio 10.0\Team Tools\Performance Tools;C:\Program Files\Microsoft SDK
s\Windows\v7.0A\bin\NETFX 4.0 Tools;C:\Program Files\Microsoft SDKs\Windows\v7.0
A\bin;c:\Program Files\Microsoft Visual Studio 10.0\Common7\Tools\..\..\VC\bin;C
:\cygwin\bin;C:\Program Files\Parallels\Parallels Tools\Applications;C:\Windows\
system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShe
ll\v1.0\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\
Microsoft SQL Server\100\DTS\Binn" /f;c:\Program Files\Microsoft Visual Studio 1
0.0\Common7\Tools\..\..\VC\bin;
Obviously it's not null. How can I fix the problem?
My build experience is as follow. See more at http://blog.csdn.net/lzl124631x/article/details/18098361
Environment:
Operating System: Windows 7 Ultimate 32-bit
Processor: Intel Core i7 860
Installed Memory: 4.00 GB
1. Installing VS2013:
a. Install Win7 SP1 (windows6.1-KB976932-X86.exe)
b. Install 5 patches for IE10
ⅰ. Windows6.1-KB2533623-x86.msu
ⅱ. Windows6.1-KB2670838-x86.msu
ⅲ. Windows6.1-KB2729094-v2-x86.msu
ⅳ. Windows6.1-KB2731771-x86.msu
ⅴ. Windows6.1-KB2786081-x86.msu
c. Install IE10 (IE10-Windows6.1-x86-en-us.exe)
d. Install VS2013 (VS2013_RTM_ULT_ENU.iso)
e. Right click on "C:\Program Files\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe", "Properties", "Compatibility", check "Run this program as an administrator".
2. Installing Cygwin
a. Download cygwin-downloader.zip (http://svn.webkit.org/repository/webkit/trunk/Tools/CygwinDownloader/cygwin-downloader.zip) and unzip it.
b. Run cygwin-downloader.exe and wait...
c. Run setup.exe, select "Install from Local Directory" and install.
d. Run setup.exe, select "Install from Internet"
i. In steps before "Select Packages", just select default folder, whatever connection and download site.
ⅱ. Select Packages: Search "gcc", expand Devel, select "gcc-g++: GNU Compiler Collection(C++)"
ⅲ. Select Packages: Search "gdb", expand Devel, select "gdb: The GNU Debugger"
See more at "Installing gcc with Cygwin"(http://www.eecg.utoronto.ca/~aamodt/ece242/cygwin.html)
e. Open C:\cygwin\etc\profile
ⅰ. Modify line 32 to PATH="/bin:${PATH}"
ⅱ. Comment line 44-50 by adding '#' at the beginning of each line.
3. Installing SDKs
a. Install QuickTime SDK (https://developer.apple.com/quicktime/)
b. Install Direct SDK (June 2010 DirectX SDK:http://www.microsoft.com/en-us/download/details.aspx?id=6812)
4. Getting the Code
a. Download Nightly Build (http://nightly.webkit.org/) and unzip it. My version is WebKit-r161524.
b. Suppress Warning 4309: Open "WebKitLibraries/win/tools/vsprops/common.props", find tag , add 4309.
c. Download Support Library (https://developer.apple.com/opensource/internet/webkit_sptlib_agree.html) and copy it into WebKit-r161524. DO NOT unzip it.
d. Open Source/WebCore/platform/LocalizedString.cpp, search "Look Up", delete the DOUBLE-BYTE double quotation marks around “%#” and “”.
5. Save the following lines as a .cmd/.bat file. I named it as Build.cmd.
#echo off
echo Setting up links...
set CYGWIN_DIR=C:\cygwin
set WEBKIT_SOURCE_DIR=%~dp0%
if "%WEBKIT_SOURCE_DIR:~-1%"=="\" set WEBKIT_SOURCE_DIR=%WEBKIT_SOURCE_DIR:~0,-1%
for /R "delims=\" %%a in (%WEBKIT_SOURCE_DIR%) do set WEBKIT_DIR_NAME=%%~nxa
set WEBKIT_LINK_DIR=%CYGWIN_DIR%\home\%username%\%WEBKIT_DIR_NAME%
if exist "%WEBKIT_LINK_DIR%" rmdir "%WEBKIT_LINK_DIR%"
mklink /D "%WEBKIT_LINK_DIR%" "%WEBKIT_SOURCE_DIR%"
echo Exporting environment varibles...
set WEBKIT_OUTPUTDIR=%WEBKIT_LINK_DIR%\WebKitBuildByCygwin
set WEBKIT_LIBRARIES=%WEBKIT_LINK_DIR%\WebKitLibraries\win
set VSINSTALLDIR=%VS120COMNTOOLS%..\..
set PATH=%WEBKIT_LINK_DIR%\Tools\Scripts;%PATH%
echo Running Cygwin...
call "%CYGWIN_DIR%\Cygwin.bat"
:exit
6. Build
a. run Build.cmd
b. update-webkit
c. build-webkit --debug | tee WebKit-r161524/log.txt
Other Material:
a. Building on Windows:http://trac.webkit.org/wiki/BuildingOnWindows (WebKit Team's note on building on windows)
b. WebKit Wiki: http://trac.webkit.org/wiki/WikiStart
Error Solutions:
---------------------------------------------------------------------
Error Message:
17> sh: /usr/bin/gcc: No such file or directory
17> Failed to read names from file: /cygdrive/g/WEBKIT~1/Source/WebCore/html/HTMLTagNames.in at /cygdrive/g/WEBKIT~1/Source/WebCore/dom/make_names.pl line 324.
17> /cygdrive/g/WEBKIT~1/Source/WebCore/DerivedSources.make:942: recipe for target 'HTMLElementFactory.cpp' failed
17> make: *** [HTMLElementFactory.cpp] Error 127
17> make: *** Waiting for unfinished jobs....
17> ./CSSGrammar.y:62.1: error: syntax error, unexpected end of file
Solution:
Install gcc to Cygwin (step 2.d).
---------------------------------------------------------------------
Error Message:
17> build-generated-files.sh: line 59: cd: /home/Moon/WEBKIT~1/WEBKIT~2/Debug/obj32/WebCore/DerivedSources: Permission denied
18> c1xx : fatal error C1083: Cannot open source file: 'C:\cygwin\home\Moon\WebKit-r161524\WebKitBuildByCygwin\Debug\obj32\WebCore\DerivedSources\CSSPropertyNames.cpp': No such file or directory
Solution:
Right click on "C:\Program Files\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe", "Properties", "Compatibility", check "Run this program as an administrator"
---------------------------------------------------------------------
Error Message:
..\platform\LocalizedStrings.cpp(248): error C2001: newline in constant
Or
..\platform\LocalizedStrings.cpp(250): error C2001: newline in constant
Solution:
Open Source/WebCore/platform/LocalizedString.cpp, search "Look Up", delete the DOUBLE-BYTE double quotation marks around “%#” and “”.
In my case the problems I faced were the following:
Missing cygwin tool such as perl, make python o ruby:
execute the setup of cygwin and install the missing components.
Conflictive components installed in cygwin and windows at the same time. For instance, if you have python installed in your windows and it is also installed in cygwin, then it's possible that depending on which version is specified in the path, you would get errors related to library versions or problems finding files due the different folder separator character used in the paths ("\" vs "/")
remediation: uninstall the conflictive component from windows and let the one installed in cygwin
Build script doesn't found the installed SDK: Consider to edit the script and point to the SDK that you have currently installed. You can use regedit to find out the key that corresponds to your SDK in your machine. In my case I added the key that corresponds to my current windows SDK "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v7.0A" in the script webkitdirs.pm:
line 1523: my #windowsPlatformSDKRegistryEntries = (
line 1524: "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v8.0A",
line 1525: "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v8.0",
line 1526: "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v7.1A",
line 1527: "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v7.1",
line 1528: "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v7.0A",
line 1529: "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/MicrosoftSDK/InstalledSDKs/D2FF9F89-8AA2-4373-8A31-C838BF4DBBE1", line 1530:);
Encoding issues: if you see there is some file that prevent the building, open the file and ensure it has not encoding issues related to DOS / Unix encoding types.
Remediation: download the problematic file with the right encoding and try again.
Problems related to missing files or files not found:
Ensure to execute the script with administrator permissions. in some cases 3rd party tools invoked by the script are the ones without permissions. if it is the case consider to edit the settings of the involved application and change the compatibility to "run as administrator"