Sunday, 7 June 2020

python ImportError: cannot import name 'open_code' from 'io'

I faced python errors:

  1. First error:
    Fatal Python error: init_sys_streams: can't initialize sys standard streams
    Traceback (most recent call last):
      File "/home/user/miniconda3/envs/py38/lib/python3.8/io.py", line 54, in <module>
    ImportError: cannot import name 'open_code' from 'io' (unknown location)
    Aborted (core dumped)
    This error comes from the fact that there are two different versions of Python conflicting with each other.

  2. Second error:
tack Error: Command failed: E:\ProgramData\Anaconda3\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack   File "<string>", line 1
gyp ERR! stack     import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack                                ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:303:12)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at maybeClose (internal/child_process.js:1021:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
gyp ERR! System Windows_NT 10.0.18363

This error because it required old version of python 2.7

To solve these errors we need to install multiple versions of python and switch between them

You can use this command to install python version
nvm install v6.11.4

You can use this command to list all python versions
nvm list

You can use this command to set default version
nvm use v6.11.4




MSBUILD error

I have tried the troubleshooting steps for installing node-sass. But it did not work fine. It did not installed the node-sass and generated errors.

  E:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(390,5): error MSB8020: The build tools for Visual Studio 2017 (Platform Toolset = 'v141') cannot be found. To build using the v141 build tools, please install Visual Studio 2017 build tools.  Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution". [E:\Code\Liferay\com-liferay-commerce-7.1.x\commerce-bom-admin-web\node_modules\node-sass\build\src\libsass.vcxproj]
 
Install all the required tools and configurations using Microsoft's windows-build-tools by running:
npm install -g windows-build-tools  (install msbuild visual studio 2017)

set msbuild visual studio 2017 set as default:
npm config set msbuild_path "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe"

After that my problem was solved

Friday, 5 June 2020

CPUs are not running at its full capacity in Windows 10

Suddenly I found my CPUs are not running at its full capacity (max 30%).
I found solution Disable Intelppm registry in Registry Editor:
  1. Edit the registry (HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\intelppm\Start = 4
  2. Or Execute "sc config intelppm start= disabled"
  3. Reboot your computer.
I found this solution in the following article:

Hyper-V - "Video Remoting Was Disconnected" Error

Some times i face "Video Remoting Was Disconnected" Error when try connection with Hyper-V

The problem eventually was solved by resetting the C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys folder permissions using the following commands

md c:\temp

icacls C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys /t /c > c:\temp\BeforeScript_permissions.txt

takeown /f "C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys" /a /r

icacls C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys /t /c /grant "NT AUTHORITY\System:(F)"

icacls C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys /t /c /grant "NT AUTHORITY\NETWORK SERVICE:(R)"

icacls C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys /t /c /grant "BUILTIN\Administrators:(F)"

icacls C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys /t /c > c:\temp\AfterScript_permissions.txt

Restart-Service TermService -Force

I found this solution in the following article

http://thefrozencoder.ca/post/2019/03/13/hyper-v-video-remoting-was-disconnected-error




Change docker images and containers location with Windows 10

Docker with windows has 2 mode windows and linux (wsl) For Windows Mode: Docker Configuration File: By default, Docker stores Images and ot...