Running gensim failing after install in anaconda - gensim

I have downloaded anaconda and have also successfully downloaded gensim.
I am trying to run gensim but not making much progress. I am running jupyter.
When I try the following command in jupyter:
from gensim.models.doc2vec import Doc2Vec
I get the following:
At line:1 char:1
+ from gensim.models.doc2vec import Doc2Vec
+ ~~~~
The 'from' keyword is not supported in this version of the language.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : ReservedKeywordNotAllowed
What am I missing?

Related

How to install Cypress from local zip file using npm

I wanted to install Cypress using npm - but my corporate firewall is blocking.
So I tried the below method in my Terminal in Visual Studio Code - But getting an error (pasted below)
Any idea on why this script does not work? and solution to it?
PS C:\Users\c64881a\Desktop\NPM_Cypress> CYPRESS_INSTALL_BINARY=C:/Users/c64881a/Downloads/cypress.zip npm install cypress
CYPRESS_INSTALL_BINARY=C:/Users/c64881a/Downloads/cypress.zip : The term 'CYPRESS_INSTALL_BINARY=C:/Users/c64881a/Downloads/cypress.zip' is not recognized as
the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct
and try again.
At line:1 char:1
CYPRESS_INSTALL_BINARY=C:/Users/c64881a/Downloads/cypress.zip npm ins ...
+ CategoryInfo : ObjectNotFound: (CYPRESS_INSTALL...ads/cypress.zip:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Please, try this in PowerShell:
setx CYPRESS_INSTALL_BINARY C:/Users/c64881a/Downloads/cypress.zip

Error while installing kubectl in Windows 10

Installing the kubectl on windows 10 not working. I follow this URL.
I tried different install options, in the powershell and using chocolote. None of them worked for me. The error is clear that this execuable is not supported for windows os. I did checked the SHA but it is different.
PS D:\chocoloate_tmpdir> curl -o kubectl.exe.sha256 https://amazon-eks.s3-us-west-2.amazonaws.com/1.14.6/2019-08-22/bin/windows/amd64/kubectl.exe.sha256
PS D:\chocoloate_tmpdir> Get-FileHash kubectl.exe
Algorithm Hash Path
--------- ---- ----
SHA256 02F984988E490046CBC831A582D34505C28C7DD9AB61C357E264C7178596B701 D:\chocoloate_tmpdir\kubectl.exe
PS D:\chocoloate_tmpdir> Get-FileHash .\kubectl.exe.sha256
Algorithm Hash Path
--------- ---- ----
SHA256 98BCEB6AF839704828C28709B60628E25CF5F624A6D6E7D06F1FC255AA4254CB D:\chocoloate_tmpdir\kubectl.exe.sha256
question is, what could be the issue and what other methods are available for installing kubectl in windows.
Here are the commands tried and error output:
one:
PS D:\chocoloate_tmpdir> choco install kubernetes-cli Chocolatey v0.10.15
Installing the following packages:
kubernetes-cli
By installing you accept licenses for the packages.
Progress: Downloading kubernetes-cli 1.17.1... 100%
kubernetes-cli v1.17.1 [Approved]
kubernetes-cli package files install completed. Performing other installation steps.
The package kubernetes-cli wants to run 'chocolateyInstall.ps1'.
Note: If you don't run this script, the installation will fail.
Note: To confirm automatically next time, use '-y' or consider:
choco feature enable -n allowGlobalConfirmation
Do you want to run the script?([Y]es/[A]ll - yes to all/[N]o/[P]rint): Y
Extracting 64-bit C:\ProgramData\chocolatey\lib\kubernetes-cli\tools\kubernetes-client-windows-amd64.tar.gz to C:\ProgramData\chocolatey\lib\kubernetes-cli\tools...
C:\ProgramData\chocolatey\lib\kubernetes-cli\tools
Extracting 64-bit C:\ProgramData\chocolatey\lib\kubernetes-cli\tools\kubernetes-client-windows-amd64.tar to C:\ProgramData\chocolatey\lib\kubernetes-cli\tools...
C:\ProgramData\chocolatey\lib\kubernetes-cli\tools
ShimGen has successfully created a shim for kubectl.exe
The install of kubernetes-cli was successful.
Software installed to 'C:\ProgramData\chocolatey\lib\kubernetes-cli\tools'
Chocolatey installed 1/1 packages.
See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
PS D:\chocoloate_tmpdir> kubectl version --client Program 'kubectl.exe' failed to run: The specified executable is not a valid application for this OS platform.At line:1 char:1
+ kubectl version --client
+ ~~~~~~~~~~~~~~~~~~~~~~~~.
At line:1 char:1
+ kubectl version --client
+ ~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ResourceUnavailable: (:) [], ApplicationFailedException
+ FullyQualifiedErrorId : NativeCommandFailed
two:
PS D:\chocoloate_tmpdir> curl -o kubectl.exe https://amazon-eks.s3-us-west-2.amazonaws.com/1.14.6/2019-08-22/bin/windows/amd64/kubectl.exe
PS D:\chocoloate_tmpdir> cp .\kubectl.exe C:\bin\
PS D:\chocoloate_tmpdir> kubectl version Program 'kubectl.exe' failed to run: The specified executable is not a valid application for this OS platform.At line:1 char:1
+ kubectl version
+ ~~~~~~~~~~~~~~~.
At line:1 char:1
+ kubectl version
+ ~~~~~~~~~~~~~~~
+ CategoryInfo : ResourceUnavailable: (:) [], ApplicationFailedException
+ FullyQualifiedErrorId : NativeCommandFailed
You've probably missed some of these steps:
Copy the binary to a folder in your PATH. If you have an existing
directory in your PATH that you use for command line utilities, copy
the binary to that directory. Otherwise, complete the following steps.
Create a new directory for your command line binaries, such as C:\bin.
Copy the kubectl.exe binary to your new directory.
Edit your user or system PATH environment variable to add the new directory to your PATH.
Close your PowerShell terminal and open a new one to pick up the new PATH variable.
Please verify what is the current content of your PATH. You can move your kubectl binary directly to one of those folders which are already added to your PATH. Alternatively you may edit it and add your desired directory containing kubectl. Have you relaunched your PowerShell terminal after saving the changes ? It's quite straightforward to configure and there is no need to use full paths to the executable.
Take a look at this article in the official kubernetes docs.
Please let me know if it helps.
Calling the command from the current path does the trick. I have added the executable to c:\bin path and added the path to system environment variable, somehow it was not set, not sure why. Its an issue with the execuable being not found in the path.
PS D:\chocoloate_tmpdir> kubectl version Program 'kubectl.exe' failed to run: The specified executable is not a valid application for this OS platform.At line:1 char:1
+ kubectl version
+ ~~~~~~~~~~~~~~~.
At line:1 char:1
+ kubectl version
+ ~~~~~~~~~~~~~~~
+ CategoryInfo : ResourceUnavailable: (:) [], ApplicationFailedException
+ FullyQualifiedErrorId : NativeCommandFailed
PS D:\chocoloate_tmpdir> .\kubectl.exe version Client Version: version.Info{Major:"1", Minor:"14+", GitVersion:"v1.14.7-eks-1861c5", GitCommit:"1861c597586f84f1498a9f2151c78d8a6bf47814", GitTreeState:"clean", BuildDate:"2019-09-24T22:12:08Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"windows/amd64"}
Unable to connect to the server: dial tcp [::1]:8080: connectex: No connection could be made because the target machine actively refused it.

Anaconda Modules Inaccessible

Disclaimer: something went wrong with my Anaconda environment at one point and my best guess was simply to uninstall/reinstall Anaconda, but now I have been getting the following errors.
I have reinstalled Anaconda successfully, and can verify the presence of various modules. However, when I try to call any given module in Terminal (e.g., jupyter notebook) I get a variation of the following error:
Traceback (most recent call last):
File "/Users/MYNAME/anaconda3/bin/jupyter", line 7, in <module>
from jupyter_core.command import main
ImportError: No module named jupyter_core.command
I do not have sufficient experience with command line programming to decipher other posts on this topic... I'm assuming there's a problem with the executable paths or something? If it helps, here is the output of conda info for me:
active environment : None
shell level : 0
user config file : /Users/MYNAME/.condarc
populated config files : /Users/MYNAME/.condarc
conda version : 4.6.8
conda-build version : 3.17.6
python version : 3.7.1.final.0
base environment : /anaconda3 (writable)
channel URLs : https://repo.anaconda.com/pkgs/main/osx-64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/free/osx-64
https://repo.anaconda.com/pkgs/free/noarch
https://repo.anaconda.com/pkgs/r/osx-64
https://repo.anaconda.com/pkgs/r/noarch
package cache : /anaconda3/pkgs
/Users/MYNAME/.conda/pkgs
envs directories : /anaconda3/envs
/Users/MYNAME/.conda/envs
platform : osx-64
user-agent : conda/4.6.8 requests/2.21.0 CPython/3.7.1
Darwin/18.5.0 OSX/10.14.4
UID:GID : MYUID
netrc file : None
offline mode : False
Just reinstall jupyter notebook under that specific conda virtual environment.
Like:
balabala$ conda activate tensorflow_gpuenv
balabala$ pip install jupyter
(I am using ubuntu.)

Unable to find module providers

I'm having an issue with PowerShell. It's almost like it's not installed all the way; which is weird since it's Windows 10 and it ships with it.
With no lock, I've tried replacing the following directories with a fresh copy from another Windows 10 machine that is working:
C:\Users\UserName\AppData\Local\PackageManagement
C:\Program Files\WindowsPowerShell
C:\Program Files (x86)\WindowsPowerShell
C:\Windows\System32\WindowsPowerShell
I also tried SFC /scannow, but it found no issues. I've searched for hours and haven't been able to find anyone with the exact same issue. Does anyone have any ideas?
System Information:
PS C:\WINDOWS\system32> [environment]::OSVersion.Version
Major Minor Build Revision
----- ----- ----- --------
10 0 10586 0
PS C:\WINDOWS\system32> $PSVersionTable.PSVersion
Major Minor Build Revision
----- ----- ----- --------
5 0 10586 122
Errors:
PS C:\WINDOWS\system32> Get-PSRepository
PackageManagement\Get-PackageSource : Unable to find module providers (PowerShellGet).
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:3544 char:31
+ ... ckageSources = PackageManagement\Get-PackageSource #PSBoundParameters
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument:(Microsoft.Power...etPackageSource:GetPackageSource) [Get-PackageSource
], Exception
+ FullyQualifiedErrorId : UnknownProviders,Microsoft.PowerShell.PackageManagement.Cmdlets.GetPackageSource
PS C:\WINDOWS\system32> Get-PackageProvider -Name PSModule -ForceBootstrap
Get-PackageProvider : Unable to find package provider 'PSModule'. It may not be imported yet. Try 'Get-PackageProvider
-ListAvailable'.
At line:1 char:1
+ Get-PackageProvider -Name PSModule -ForceBootstrap
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Microsoft.Power...PackageProvider:GetPackageProvider) [Get-PackageProvi
der], Exception
+ FullyQualifiedErrorId : UnknownProviderFromActivatedList,Microsoft.PowerShell.PackageManagement.Cmdlets.GetPacka
geProvider
The below returns nothing:
PS C:\WINDOWS\system32> Get-PackageProvider -ListAvailable
PS C:\WINDOWS\system32>
If your end goal is to install packages from Chocolatey or something similar with PowerShell you would want to perform the following.
To import the Module you would execute the following:
Import-Module PackageManagement
To install the package providers you would execute the following:
Install-PackageProvider -Name Chocolatey -Force
To find a package within the package provider Chocolatey you would execute the following (you could use wildcard for name to get all packages available):
Find-Package -Name SomePackageNameHere -ProviderName Chocolatey
Lastly, to install a package from Chocolatey you would execute the following:
Install-Package -Name SomePackageNameHere -ProviderName Chocolatey -Force
I hope this helps!
Looks like I solved the issue. I installed Chocolatey by using the CMD.exe method.
I ran CMD.exe as an administrator and ran the following command:
#powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
Now I have a PS Repository:
PS C:\WINDOWS\system32> Get-PSRepository
Name PackageManagementProvider InstallationPolicy SourceLocation
---- ------------------------- ------------------ --------------
PSGallery NuGet Untrusted https://www.powershellgallery.com/api/v2/
I'm guessing something during the install of Chocolatey, repaired whatever was broken.

apportable : No module named argparse error on mac

i just installed apportable from here : http://www.apportable.com/users/1928
now , after installing successfully it gives this error :
Traceback (most recent call last):
File "/Users/macintosh/.apportable/SDK/bin/apportable", line 3, in
import argparse
ImportError: No module named argparse
i can understand it's import issue .. but i am not able to resolve this .. can anyone help on this !! i have tried this for many times & still same error .. what could be the possible resolution to this.
please help !
You may have an old python. You should have version 2.7+:
$ python --version
Python 2.7.2
Or old MacOS X. Apportable requires Mac OS X 10.7+.

Resources