最近在 VS code 中运行脚本(我的任何 python、javascript、html...脚本)时出现了一个问题。出现一个弹出窗口:Visual Studio Code - Unable to launch Browser: "Unable to find an installation of the browser on your system.Try installing it, or providing an absolute path to the browser in the "runtimeExecutable" in your launch.json.
我的浏览器是边缘浏览器。当我打开时,launch.json我发现它似乎正在尝试使用我没有在计算机上下载的 Chrome。
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "pwa-chrome",
"request": "launch",
"name": "Launch Chrome against …Run Code Online (Sandbox Code Playgroud) 我有一个以前可以工作的 python 脚本,但现在抛出错误:ImportError: DLL load failed while importing _gdal: The specified module could not be found.我正在尝试使用 fiona 上传 shapefile,最初的消息是:ImportError: DLL load failed while importing _fiona: The specified module could not be found.我在 Windows 11 上使用 anaconda navigator 作为我的 IDE。
我知道这是一个以前被问过的问题,并且我已经阅读了这些问题的答案。然而,由于我的情况或我的误解和执行它的行动,这些解决方案并没有奏效。所以我的问题是如何解决这个问题,或者,如果不是那么简单,更好地理解这个问题。
我查看了我正在使用的环境文件夹中的 DLLs 文件夹,里面没有任何名称为 fiona、gdal 或 geopandas 的内容。
到目前为止我的尝试:
1.卸载并重新安装fiona gdal和geopandas(因为我相信它们是依赖的)。
2.将所有库和anaconda更新到最新版本。
3.下载 Visual C++ Redistributable for Visual Studio 2015。在下载过程中遇到问题,因为它已经安装在我的计算机上,可能是因为它是 Windows 计算机。如果我将其移动到不同的路径/文件夹,这可能会有帮助吗?
4.在计算机上卸载并重新安装 anaconda navigator。重新创建虚拟环境并导入必要的库。结果:行中的错误import geopandas as gpd::ImportError: …
当我尝试将 csv 文件作为地理数据框上传时,我收到此错误。根据本网站上的其他问题解决方案,此方法应该可以解决问题。
\n这是我用来执行的代码:将文件上传为 gdf,然后生成仅包含某些列的子集数据帧。
\ncp_union = gpd.read_file(r'C:\\Users\\User\\Desktop\\CPAWS\\terrestrial_outputs\\cp_union.csv')\ncp_union.crs = 'epsg:3005'\n\ncp_trimmed = cp_union[['COSEWIC_status','reason_for_designation','cnm_eng','iucn_cat','mgmt_e','status_e','classification','sq_m']]\nRun Code Online (Sandbox Code Playgroud)\n如标题中所述,我收到的错误是这样的:将ValueError: GeoDataFrame does not support multiple columns using the geometry column name 'geometry'.gdf 保存为 csv 然后将其重新加载为 gdf 的过程中是否有某些部分会导致创建额外的几何列?
编辑
\n在另一个脚本中,我加载了与 pd 数据框相同的 csv 文件。这是该 pd 数据帧中的第一行数据。
\n Unnamed: 0 0\nfid_critic 0\nscntfc_nm Castilleja victoriae\ncnm_eng Victoria's Owl-clover\ncnm_fren Castill\xc3\xa9jie de Victoria\ncswc_pop NaN\nch_stat Final\ncb_site_nm Cattle Point\nch_detail Detailed Polygon\nch_variant NaN\nch_method NaN\nhectares 0.8559\nutm_zone 10\nutm_east 478383\nutm_north 5365043\nlatitude 48.438164\nlongitude -123.29226\nshape_1 0.0\nobjectid 10251681.0\narea_sqm 8478.6733\nfeat_len 326.5008\nfid_protec -1\nname_e NaN\nname_f NaN\naichi_t11 NaN\niucn_cat NaN\noecm …Run Code Online (Sandbox Code Playgroud)