Skip to content
This repository was archived by the owner on Feb 19, 2019. It is now read-only.
This repository was archived by the owner on Feb 19, 2019. It is now read-only.

Cannot install python packages with CPython command on Windows 8 #117

Closed

Description

@awright18

When trying to run cpython django I received the following error:

Get-Content : Cannot find path 'C:\Chocolatey\chocolateyInstall\chocolateyPythonInstall.log' because it does not exist.

at C:\Chocolatey\chocolateyInstall\functions\Chocolatey-Python.ps1:51 char:20

  • $installOutput - Get-Content $chocoInstallLoag - Encodeing Ascii
    • CategoryInfo : Object NotFound: (C:\Chocolatey\c...thoniINstall.log:String) [Get-Content], ItemNotFoundException
    • FullyQualifiedErrorId : PathNotFound.Microsoft.Powershell.Commands.GetContentCommand

I fixed the problem locally by adding the following code to Chocolatey\chocolateyInstall\functions\Chocolatey-Python.ps1:

if(-Not (Test-Path ($chocoInstallLog))) {
Write-Debug "Creating Python install log file.
New-Item $chocoInstallLog -type file
}

immediately before

$installOutput = Get-Content $chocoInstallLog -Encoding Ascii
foreach ($line in $installOutput) {
Write-Host $line
}

It appears the the Chocolatey-RubyGem.ps1 in the same directory has a similar line commented out.

$installOutput = Get-Content $chocoInstallLog -Encoding Ascii

#foreach ($line in $installOutput) {

Write-Host $line

#}

The Chocolatey-WebPI.ps1 in the same directory also attempts to write to its install log.
$installOutput = Get-Content $chocoInstallLog -Encoding Ascii
foreach ($line in $installOutput) {
Write-Host $line
}

The real issue seams to be that the install logs are removed at the beginning of all 3 scripts.

$chocoInstallLog = Join-Path $nugetChocolateyPath 'chocolateyWebPiInstall.log';
Remove-LastInstallLog $chocoInstallLog

and they are not recreated. I would assume a good solution would be to have a script like Create-InstallLog that takes $logfile or something like that that gets run after the Remove-LastInstallLog command.

Thanks!

Activity

  1. ferventcoder commented on Jun 26, 2012

    @ferventcoder
    Contributor

    Might have missed something in there with python. Ruby I converted back to not using the config file or external process.

  2. ferventcoder commented on Jun 26, 2012

    @ferventcoder
    Contributor

    Thanks for reporting this...

  3. ferventcoder commented on Jun 28, 2012

    @ferventcoder
    Contributor

    Per chance does your chocolatey path have spaces in it?

  4. ferventcoder commented on Jun 28, 2012

    @ferventcoder
    Contributor

    Fixed in 8743e1c

  5. ferventcoder commented on Jun 28, 2012

    @ferventcoder
    Contributor

    I found that the easy.install nuget package (I don't own is a little wonky). It may take a couple of tries to get it to work right.

  6. awright18 commented on Jun 28, 2012

    @awright18
    Author

    The fix looks great. Thanks for taking care of that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions