Alright, I moved the application back to the original ren’py folder and now this error appears! >:(
Code: Select all
I'm sorry, but an uncaught exception occurred.
AttributeError: 'pygame.Surface' object has no attribute 'surface'
While running game code:
- script at line 784 of renpy-6.11.0/common/00library.rpy
- python at line 788 of renpy-6.11.0/common/00library.rpy.
- script at line 23 of renpy-6.11.0/common/_layout/classic_main_menu.rpym
-- Full Traceback ------------------------------------------------------------
File "C:Documents and SettingsAdministratorDesktopGame filerenpy-6.11.0renpybootstrap.py", line 252, in bootstrap
File "C:Documents and SettingsAdministratorDesktopGame filerenpy-6.11.0renpymain.py", line 310, in main
File "C:Documents and SettingsAdministratorDesktopGame filerenpy-6.11.0renpymain.py", line 93, in run
File "C:Documents and SettingsAdministratorDesktopGame filerenpy-6.11.0renpyexecution.py", line 250, in run
File "C:Documents and SettingsAdministratorDesktopGame filerenpy-6.11.0renpyast.py", line 567, in execute
File "C:Documents and SettingsAdministratorDesktopGame filerenpy-6.11.0renpypython.py", line 957, in py_exec_bytecode
File "renpy-6.11.0/common/00library.rpy", line 788, in <module>
File "C:Documents and SettingsAdministratorDesktopGame filerenpy-6.11.0renpygame.py", line 297, in call_in_new_context
File "C:Documents and SettingsAdministratorDesktopGame filerenpy-6.11.0renpyexecution.py", line 250, in run
File "C:Documents and SettingsAdministratorDesktopGame filerenpy-6.11.0renpyast.py", line 567, in execute
File "C:Documents and SettingsAdministratorDesktopGame filerenpy-6.11.0renpypython.py", line 957, in py_exec_bytecode
File "renpy-6.11.0/common/_layout/classic_main_menu.rpym", line 56, in <module>
File "C:Documents and SettingsAdministratorDesktopGame filerenpy-6.11.0renpyui.py", line 216, in interact
File "C:Documents and SettingsAdministratorDesktopGame filerenpy-6.11.0renpydisplaycore.py", line 1607, in interact
File "C:Documents and SettingsAdministratorDesktopGame filerenpy-6.11.0renpydisplaycore.py", line 1947, in interact_core
File "C:Documents and SettingsAdministratorDesktopGame filerenpy-6.11.0renpydisplaycore.py", line 1307, in draw_screen
File "C:Documents and SettingsAdministratorDesktopGame filerenpy-6.11.0renpydisplayrender.py", line 353, in render_screen
File "C:Documents and SettingsAdministratorDesktopGame filerenpy-6.11.0renpydisplayrender.py", line 141, in render
File "C:Documents and SettingsAdministratorDesktopGame filerenpy-6.11.0renpydisplaylayout.py", line 506, in render
File "C:Documents and SettingsAdministratorDesktopGame filerenpy-6.11.0renpydisplayrender.py", line 141, in render
File "C:Documents and SettingsAdministratorDesktopGame filerenpy-6.11.0renpydisplaylayout.py", line 506, in render
File "C:Documents and SettingsAdministratorDesktopGame filerenpy-6.11.0renpydisplayrender.py", line 141, in render
File "C:Documents and SettingsAdministratorDesktopGame filerenpy-6.11.0renpydisplaylayout.py", line 506, in render
File "C:Documents and SettingsAdministratorDesktopGame filerenpy-6.11.0renpydisplayrender.py", line 141, in render
File "C:Documents and SettingsAdministratorDesktopGame filerenpy-6.11.0renpydisplaylayout.py", line 796, in render
File "C:Documents and SettingsAdministratorDesktopGame filerenpy-6.11.0renpydisplayrender.py", line 141, in render
File "C:Documents and SettingsAdministratorDesktopGame filerenpy-6.11.0renpydisplayimage.py", line 139, in render
File "C:Documents and SettingsAdministratorDesktopGame filerenpy-6.11.0renpydisplayimage.py", line 33, in wrap_render
File "C:Documents and SettingsAdministratorDesktopGame filerenpy-6.11.0renpydisplayrender.py", line 141, in render
File "C:Documents and SettingsAdministratorDesktopGame filerenpy-6.11.0renpydisplaymotion.py", line 664, in render
File "C:Documents and SettingsAdministratorDesktopGame filerenpy-6.11.0renpydisplayrender.py", line 141, in render
File "C:Documents and SettingsAdministratorDesktopGame filerenpy-6.11.0renpydisplaylayout.py", line 506, in render
File "C:Documents and SettingsAdministratorDesktopGame filerenpy-6.11.0renpydisplayrender.py", line 141, in render
File "C:Documents and SettingsAdministratorDesktopGame filerenpy-6.11.0renpydisplaymotion.py", line 664, in render
File "C:Documents and SettingsAdministratorDesktopGame filerenpy-6.11.0renpydisplayrender.py", line 141, in render
File "C:Documents and SettingsAdministratorDesktopGame filerenpy-6.11.0renpydisplayimage.py", line 195, in render
File "C:Documents and SettingsAdministratorDesktopGame filerenpy-6.11.0renpydisplayimage.py", line 33, in wrap_render
File "C:Documents and SettingsAdministratorDesktopGame filerenpy-6.11.0renpydisplayrender.py", line 141, in render
File "C:Documents and SettingsAdministratorDesktopGame filerenpy-6.11.0renpydisplayim.py", line 451, in render
File "C:Documents and SettingsAdministratorDesktopGame filerenpy-6.11.0renpydisplayswdraw.py", line 949, in load_texture
File "C:Documents and SettingsAdministratorDesktopGame filerenpy-6.11.0renpydisplayscale.py", line 467, in copy_surface
AttributeError: 'pygame.Surface' object has no attribute 'surface'
While running game code:
- script at line 784 of renpy-6.11.0/common/00library.rpy
- python at line 788 of renpy-6.11.0/common/00library.rpy.
- script at line 23 of renpy-6.11.0/common/_layout/classic_main_menu.rpym
Ren'Py Version: Ren'Py 6.11.0l
i think my computer hates me…
I’ve installed a 64 bit JDK, Java itself, and RAPT, but every time I try to «install SDK and create keys» in RenPy I keep getting this error:
File «game/android.rpy», line 507, in <module>
File «game/mobilebuild.rpy», line 214, in call
File «game/mobilebuild.rpy», line 238, in check_process
CalledProcessError: Command ‘[‘C:\Progra~1\Eclipse Adoptium\jdk-17.0.3.7-hotspot\bin\java.exe’, ‘-classpath’, ‘C:\Users\***\Documents\renpy-7.4.10-sdk\rapt\buildlib’, ‘CheckJDK8′]’ returned non-zero exit status 1.
— Full Traceback ————————————————————
Full traceback:
File «launcher/game/android.rpyc», line 505, in script
File «C:Users***Documentsrenpy-7.4.10-sdkrenpyast.py», line 1111, in execute
renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
File «C:Users***Documentsrenpy-7.4.10-sdkrenpypython.py», line 1048, in py_exec_bytecode
exec(bytecode, globals, locals)
File «game/android.rpy», line 507, in <module>
File «C:Users***Documentsrenpy-7.4.10-sdkraptbuildlibraptinstall_sdk.py», line 356, in install_sdk
check_java(interface)
File «C:Users***Documentsrenpy-7.4.10-sdkraptbuildlibraptinstall_sdk.py», line 55, in check_java
if not run_slow(interface, plat.java, «-classpath», plat.path(«buildlib»), «CheckJDK8», use_path=True):
File «C:Users***Documentsrenpy-7.4.10-sdkraptbuildlibraptinstall_sdk.py», line 37, in run_slow
interface.call(args, cancel=True, **kwargs)
File «game/mobilebuild.rpy», line 214, in call
File «C:Users***Documentsrenpy-7.4.10-sdkrenpyexports.py», line 3164, in call_screen
rv = renpy.ui.interact(mouse=»screen», type=»screen», roll_forward=roll_forward)
File «C:Users***Documentsrenpy-7.4.10-sdkrenpyui.py», line 299, in interact
rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
File «C:Users***Documentsrenpy-7.4.10-sdkrenpydisplaycore.py», line 3363, in interact
repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, pause=pause, pause_start=pause_start, **kwargs)
File «C:Users***Documentsrenpy-7.4.10-sdkrenpydisplaycore.py», line 4238, in interact_core
rv = root_widget.event(ev, x, y, 0)
File «C:Users***Documentsrenpy-7.4.10-sdkrenpydisplaylayout.py», line 1175, in event
rv = i.event(ev, x — xo, y — yo, cst)
File «C:Users***Documentsrenpy-7.4.10-sdkrenpydisplaylayout.py», line 1175, in event
rv = i.event(ev, x — xo, y — yo, cst)
File «C:Users***Documentsrenpy-7.4.10-sdkrenpydisplaylayout.py», line 1175, in event
rv = i.event(ev, x — xo, y — yo, cst)
File «C:Users***Documentsrenpy-7.4.10-sdkrenpydisplayscreen.py», line 743, in event
rv = self.child.event(ev, x, y, st)
File «C:Users***Documentsrenpy-7.4.10-sdkrenpydisplaylayout.py», line 1175, in event
rv = i.event(ev, x — xo, y — yo, cst)
File «C:Users***Documentsrenpy-7.4.10-sdkrenpydisplaybehavior.py», line 2393, in event
return run(self.function, *self.args, **self.kwargs)
File «C:Users***Documentsrenpy-7.4.10-sdkrenpydisplaybehavior.py», line 327, in run
return action(*args, **kwargs)
File «game/mobilebuild.rpy», line 238, in check_process
CalledProcessError: Command ‘[‘C:\Progra~1\Eclipse Adoptium\jdk-17.0.3.7-hotspot\bin\java.exe’, ‘-classpath’, ‘C:\Users\***\Documents\renpy-7.4.10-sdk\rapt\buildlib’, ‘CheckJDK8′]’ returned non-zero exit status 1.
Windows-10-10.0.19043
Ren’Py 8.0.0.22061501n
Ren’Py Launcher 8.0.0.22061501n
Thu Jun 16 14:34:49 2022
[/code]
I’ve tried looking for solutions online, but I can’t find anything that’s worked. I’ve updated the environment variables in advanced system settings for PATH and JAVA_HOME.
Any ideas what could be causing it?
*Edited to include full Traceback.
Следующий код:
import subprocess
collection = filename[:filename.find('.')]
working_directory = 'C://Users//Admin//Downloads//'
json_file = filename + '.json'
mongoimport_cmd = 'mongoimport -h 127.0.0.1:27017 ' +
'--db ' + db_name +
' --collection ' + collection +
' --file ' + working_directory + json_file
# Before importing, drop collection if it exists (i.e. a re-run)
if collection in db.collection_names():
print 'Dropping collection: ' + collection
db[collection].drop()
# Execute the command
print 'Executing: ' + mongoimport_cmd
subprocess.call(mongoimport_cmd.split())
Выдает мне эту ошибку (WindowsError: [Ошибка 2] Система не может найти указанный файл):
Executing: mongoimport -h 127.0.0.1:27017 --db sacramento --collection sacramento --file C:/Users/Admin/Downloads/sacramento.osm.json
---------------------------------------------------------------------------
WindowsError Traceback (most recent call last)
<ipython-input-232-09c1f8f6a3e4> in <module>()
16 print 'Executing: ' + mongoimport_cmd
17
---> 18 subprocess.call(mongoimport_cmd.split())
C:UsersAdminAnaconda2envsDANDlibsubprocess.pyc in call(*popenargs, **kwargs)
521 retcode = call(["ls", "-l"])
522 """
--> 523 return Popen(*popenargs, **kwargs).wait()
524
525
C:UsersAdminAnaconda2envsDANDlibsubprocess.pyc in __init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags)
709 p2cread, p2cwrite,
710 c2pread, c2pwrite,
--> 711 errread, errwrite)
712 except Exception:
713 # Preserve original exception in case os.close raises.
C:UsersAdminAnaconda2envsDANDlibsubprocess.pyc in _execute_child(self, args, executable, preexec_fn, close_fds, cwd, env, universal_newlines, startupinfo, creationflags, shell, to_close, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite)
957 env,
958 cwd,
--> 959 startupinfo)
960 except pywintypes.error, e:
961 # Translate pywintypes.error to WindowsError, which is
WindowsError: [Error 2] The system cannot find the file specified
Вещи пробовали:
Os.path.abspath.
изменение пути к файлу на относительный, абсолютный, необработанная строка, двойной люфт.
mongodb работает в фоновом режиме при выполнении этой проверки.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
у меня проблема с этим кодом. Я пытаюсь переименовать все имена файлов в папке, чтобы у них больше не было +'s
в них! Это работало много раз раньше, но вдруг я получаю ошибку:
WindowsError: [Error 2] The system cannot find the file specified at line 26
строка 26-последняя строка кода.
кто-нибудь знает, почему это происходит? Я только что пообещал кому-то, что смогу сделать это за 5 минут, потому что у меня был код! Жаль, что это не работает!!
import os, glob, sys
folder = "C:Documents and SettingsDuffABureaubladJohan10G304655_1"
for root, dirs, filenames in os.walk(folder):
for filename in filenames:
filename = os.path.join(root, filename)
old = "+"
new = "_"
for root, dirs, filenames in os.walk(folder):
for filename in filenames:
if old in filename:
print (filename)
os.rename(filename, filename.replace(old,new))
2 ответов
я подозреваю, что у вас могут быть проблемы с подкаталогами.
если у вас есть каталог с файлами «a
«,»b
» и подкаталог «dir
» с файлами «sub+1
» и «sub+2
» вызов os.walk()
даст следующие значения:
(('.',), ('dir',), ('a', 'b'))
(('dir',), (,), ('sub+1', 'sub+2'))
когда вы обрабатываете второй кортеж, вы вызовете rename()
С 'sub+1', 'sub_1'
в качестве аргументов, когда то, что вы хотите 'dirsub+1', 'dirsub_1'
.
чтобы исправить это, измените цикл в коде кому:
for root, dirs, filenames in os.walk(folder):
for filename in filenames:
filename = os.path.join(root, filename)
... process file here
который объединит каталог с именем файла, прежде чем вы что-либо с ним сделаете.
Edit:
я думаю, что это правильный ответ, но не совсем правильная причина.
если у вас есть файл «File+1
» в каталоге, os.walk()
вернутся
("C:/Documents and Settings/DuffA/Bureaublad/Johan/10G304655_1/", (,), ("File+1",))
если вы находитесь в «10G304655_1
» каталог, когда вы называете rename()
файл «File+1
» не найден в настоящее каталог, так как это не то же самое, что каталог os.walk()
смотрит на. Выполнив вызов os.path.join()
yuo говорят переименовать, чтобы посмотреть в правильном каталоге.
Изменить 2
примером требуемого кода может быть:
import os
# Use a raw string, to reduce errors with characters.
folder = r"C:Documents and SettingsDuffABureaubladJohanG304655_1"
old = '+'
new = '_'
for root, dirs, filenames in os.walk(folder):
for filename in filenames:
if old in filename: # If a '+' in the filename
filename = os.path.join(root, filename) # Get the absolute path to the file.
print (filename)
os.rename(filename, filename.replace(old,new)) # Rename the file
вы используете splitext
определить источник именем переименовать:
filename_split = os.path.splitext(filename) # filename and extensionname (extension in [1])
filename_zero = filename_split[0]#
...
os.rename(filename_zero, filename_zero.replace('+','_'))
Если вы столкнулись с файлом с расширением, очевидно, попытка переименовать имя файла без расширения приведет к ошибке» файл не найден».