修复用于安装任何软件包的Pip错误代码

时间:2020-10-09 14:45:26

标签: python matplotlib pip

对不起,我对这一切还不是很陌生,但是问题的简短背景是当我最初安装python 3.8.5和pycharm时,我按照youtube视频上的说明将python保存到自定义目录中。当我后来为我的计算课程下载其他应用程序时,其中一个(nodejs)下载了另一个版本的python(3.9),因为它无法在我的计算机上找到其他版本的python。 我决定只是卸载旧版本,然后将pycharm重新配置为新的解释器。但是自从我无法使用python安装任何软件包(例如matplotlib或scipy)以来,就一直如此。每次尝试时,都会出现以下错误。我已经卸载了该版本的python,并尝试从python网站安装新版本,但是我仍然遇到相同的问题。任何帮助将不胜感激。

我可能应该声明我当前正在使用Windows 10。

# In- and output file paths.
# Note: Be sure to use *full* paths, because .NET's working dir. usually
#       differs from PowerShell's.
$inFile = "$PWD/in.csv"
$outFile = "$PWD/out.csv"

# How many characters to read at once.
# This is a tradeoff between execution speed and memory use.
$BUFSIZE = 100MB
$buf = [char[]]::new($BUFSIZE)

$inStream = [IO.StreamReader]::new($inFile)
$outStream = [IO.StreamWriter]::new($outFile)
  
# Process the file in fixed-size blocks of characters.
while ($charsRead = $inStream.ReadBlock($buf, 0, $BUFSIZE)) {
  # Convert the array of chars. to a string.
  $block = [string]::new($buf, 0, $charsRead)
  # Transform the block and write it to the output file.
  $outStream.Write(
    # Transform block-internal LF-only newlines to spaces and perform other
    # subsitutions.
    # Note: The |^ part inside the negative lookbehind is to deal with the
    #       case where the block starts with "`n" due to the block boundaries
    #       accidentally having split a CRLF sequence.
    ($block -replace '(?<!\r|^)\n', ' ' -replace "[‘’´]", "'" -replace '[“”]', '""' -replace '\u00a0', ' ' -replace '[•·]', '*')
  )
}

$inStream.Close()
$outStream.Close()

1 个答案:

答案 0 :(得分:-1)

String body

尝试执行此操作会导致以下错误---

public class LambdaArgsTest {
    private static void display(Supplier<?> arg) {
        try {
            // this is the place where the Exception("wrong") might be thrown
            // and it is in fact handled
            System.out.println(arg.get());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] args) {
        display(() -> {
            if(/*some condition*/) {
                // this statement will be rejected due to unhandled exception
                throw new Exception("wrong");
            }
            return "abcde";
        });
    }
}